github.com/holochain/holochain-proto@v0.1.0-alpha-26.0.20200915073418-5c83169c9b5b/bin/holochain.app.findAppDir (about) 1 #!/usr/bin/env bash 2 holochainBinDir="$GOPATH/src/github.com/holochain/holochain-proto/bin" 3 4 5 FILE=".hc/immutable" 6 if [ ! -d $FILE ]; then 7 8 # check if we are in root dir, in which case, die 9 [ $PWD == "/" ] && echo "HC: this does not appear to be a holochain directory" && exit 1 10 11 # check up a directory 12 cd .. 13 . $holochainBinDir/holochain.app.findAppDir 14 else 15 { [[ -f ".hc/immutable/readableName" ]] && [[ -f ".hc/immutable/machineName" ]] ; } || { echo "HC .hc is corrupt. Please try to re-init maybe? Or fix!" && exit 1 ; } 16 17 export HOLOCHAIN_APPNAME=`cat .hc/immutable/readableName` 18 export HOLOCHAIN_APP_MACHINENAME=`cat .hc/immutable/machineName` 19 export HOLOCHAIN_APPDIR=$PWD 20 export HOLOCHAIN_APPLOGDIR="$PWD/logs.holochain" 21 fi