Repair: fix sandbox initialization script

This commit is contained in:
Vincent Botbol 2018-02-21 18:34:55 +01:00
parent 79f7cf3943
commit b78d7bdaee
2 changed files with 13 additions and 6 deletions

View File

@ -56,6 +56,9 @@ install:
@jbuilder build @install
@jbuilder install
uninstall:
@jbuilder uninstall
clean:
@-jbuilder clean
@-rm -f \
@ -67,4 +70,3 @@ clean:
@-make -C docs clean
.PHONY: all test build-deps docker-image clean

View File

@ -2,9 +2,11 @@
set -e
client_dir="${client_dir:=$HOME/.tezos-client}"
client="${client:=tezos-client -base-dir $client_dir}"
admin_client="${client:=tezos-admin-client -base-dir $client_dir}"
if [ "$is_tezos_sandboxed_init" = "1" ]; then
echo 'The client has already been initialized in this session.' >&2
echo 'Start a new shell session if you wish to reinitialize a client.' >&2
exit
fi
client_dirs=()
@ -219,8 +221,9 @@ main () {
local_client="${local_client:-$bin_dir/../../_build/default/src/bin_client/main_client.exe}"
local_admin_client="${local_admin_client:-$bin_dir/../../_build/default/src/bin_client/main_admin.exe}"
else
local_client="${local_client:-tezos-client}"
local_admin_client="${local_admin_client:-tezos-admin-client}"
# we assume a clean install with tezos-(admin-)client in the path
local_client="${local_client:-$(which tezos-client)}"
local_admin_client="${local_admin_client:-$(which tezos-admin-client)}"
fi
if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then
@ -246,7 +249,9 @@ PATH="$client_dir/bin:\$PATH" ; export PATH ;
alias tezos-activate-alpha="$client -block genesis activate protocol ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK with fitness 1 and key dictator" ;
alias tezos-client-reset="rm -rf \"$client_dir\"; unalias tezos-activate-alpha tezos-client-reset" ;
alias tezos-autocomplete="if [ \$ZSH_NAME ] ; then autoload bashcompinit ; bashcompinit ; fi ; source \"$bin_dir/bash-completion.sh\"" ;
is_tezos_sandboxed_init=1 ; export is_tezos_sandboxed_init;
trap tezos-client-reset EXIT ;
EOF
(cat | sed -e 's/^/## /') 1>&2 <<EOF