diff --git a/Makefile b/Makefile index a771fdd80..71b1de33c 100644 --- a/Makefile +++ b/Makefile @@ -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 - diff --git a/src/bin_client/tezos-init-sandboxed-client.sh b/src/bin_client/tezos-init-sandboxed-client.sh index 2f8cbae58..8a4158553 100755 --- a/src/bin_client/tezos-init-sandboxed-client.sh +++ b/src/bin_client/tezos-init-sandboxed-client.sh @@ -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 <