diff --git a/README.md b/README.md index 687b35b..54ce989 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ 3. Rename your repo to `xxh-shell-myshell` 4. Install [xxh](https://github.com/xxh/xxh) and run once to creating `~/.xxh` 5. `cd ~/.xxh/xxh/shells && git clone https://github.com/you/xxh-shell-myshell && cd xxh-shell-myshell` -6. Edit `build.xsh` script. While build you should create `build` directory with minimal group of files to run the portable shell. +6. Edit `build.sh` script. While build you should create `build` directory with minimal group of files to run the portable shell. 7. Edit `entrypoint.sh` script. This script should be copied to `build` directory while building and this script will be the main entrypoint to the shell. -8. Run `./build.xsh`. It will be great if after building you can run `build/entrypoint.sh` and open the shell locally. +8. Run `./build.sh`. It will be great if after building you can run `build/entrypoint.sh` and open the shell locally. 9. Try to connect: `xxh myhost +if +s xxh-shell-myshell` (`+if` means force reinstall). 10. Try to use commands, try to move thru directories. If everything as expected try commit and push your changes. 11. You rock! [Tell us about your work](https://gitter.im/xonssh-xxh/community)! diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..f1f641a --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash diff --git a/build.xsh b/build.xsh deleted file mode 100755 index 07695f8..0000000 --- a/build.xsh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env xonsh - -# -# Build script is needed to create `build` directory with all files needed to run portable shell on the host -# - -import sys, argparse -from shutil import which - -parser = argparse.ArgumentParser(description='build') -parser.add_argument('-q', '--quiet', action='store_true', help=f"Quiet mode") -opt = parser.parse_args() - -def eprint(*args, **kwargs): - if not opt.quiet: - print(*args, file=sys.stderr, **kwargs) - -script_dir = pf"{__file__}".absolute().parent -build_dir = script_dir / 'build' -rm -rf @(build_dir)/ -mkdir -p @(build_dir) - -cp @(script_dir / 'entrypoint.sh') @(build_dir)/ - -cd @(build_dir) -if p'your_portable_shell'.exists(): - eprint('SKIP: Portable shell already builded') -else: - shell_url='...' - eprint(f'Download from {shell_url}') - arg_q = ['-q'] if opt.quiet else [] - arg_s = ['-s'] if opt.quiet else [] - arg_progress = [] if opt.quiet else ['--show-progress'] - if which('wget'): - r =![wget @(arg_q) @(arg_progress) @(shell_url) -O your_portable_shell] - if r.returncode != 0: - eprint(f'Error while download using wget: {r}') - exit(1) - elif which('curl'): - r =![curl @(arg_s) -L @(shell_url) -o your_portable_shell] - if r.returncode != 0: - eprint(f'Error while download using curl: {r}') - exit(1) diff --git a/requirements.txt b/requirements.txt index 96d9d8a..69d340e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ xxh-xxh -xonsh