Skip to content

Commit

Permalink
shasum update (#80)
Browse files Browse the repository at this point in the history
shasum renamed -p to -U... great
  • Loading branch information
arr00 authored Aug 10, 2021
1 parent 20abad2 commit eb7a6c9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
9 changes: 8 additions & 1 deletion scenario/script/tsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ dir=`dirname $0`
scenario_dir="$(cd $dir/.. && pwd)"
parent_dir="$(cd $dir/../.. && pwd)"
cache_file="$scenario_dir/.tscache"
checksum="$(echo $scenario_dir/src/{*,**/}*.* | xargs shasum -p | shasum -p | cut -d' ' -f 1)"
shasumVersion="$(shasum -v)"
inflectionVersion="6.01"

if [ "$(printf '%s\n' "$inflectionVersion" "$shasumVersion" | sort -V | head -n1)" = "$inflectionVersion" ]; then
checksum="$(echo $scenario_dir/src/{*,**/}*.* | xargs shasum -U | shasum -U | cut -d' ' -f 1)"
else
checksum="$(echo $scenario_dir/src/{*,**/}*.* | xargs shasum -p | shasum -p | cut -d' ' -f 1)"
fi

if [ ! -d "$scenario_dir/node_modules" ]; then
echo "Getting scenario packages..."
Expand Down
9 changes: 8 additions & 1 deletion script/build_scenarios
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ root_dir="$(cd $dir/.. && pwd)"
tests_dir="$(cd $root_dir/tests && pwd)"
scenario_dir="$tests_dir/Scenarios"
cache_file="$root_dir/.scencache"
checksum="$(echo $root_dir/spec/scenario{,/**}/*.scen | xargs shasum -p | shasum -p | cut -d' ' -f 1)"
shasumVersion="$(shasum -v)"
inflectionVersion="6.01"

if [ "$(printf '%s\n' "$inflectionVersion" "$shasumVersion" | sort -V | head -n1)" = "$inflectionVersion" ]; then
checksum="$(echo $root_dir/spec/scenario{,/**}/*.scen | xargs shasum -U | shasum -U | cut -d' ' -f 1)"
else
checksum="$(echo $root_dir/spec/scenario{,/**}/*.scen | xargs shasum -p | shasum -p | cut -d' ' -f 1)"
fi

if [ -z "$rebuild" -a -f "$cache_file" ]; then
cached="$(cat $cache_file)"
Expand Down
9 changes: 8 additions & 1 deletion script/compile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ cache_file="$root_dir/.solcache"
saddle_config_file="$root_dir/saddle.config.js"
config_trace=`node -e "console.log(require(\"$saddle_config_file\").trace)"`
[[ "$*" == "--trace" ]] || [[ "$config_trace" == "true" ]] && cache_file="${cache_file}cov"
checksum="$(ls $root_dir/{contracts,contracts/**,tests/Contracts}/*.sol | xargs shasum -p | shasum -p | cut -d' ' -f 1)"
shasumVersion="$(shasum -v)"
inflectionVersion="6.01"

if [ "$(printf '%s\n' "$inflectionVersion" "$shasumVersion" | sort -V | head -n1)" = "$inflectionVersion" ]; then
checksum="$(ls $root_dir/{contracts,contracts/**,tests/Contracts}/*.sol | xargs shasum -U | shasum -U | cut -d' ' -f 1)"
else
checksum="$(ls $root_dir/{contracts,contracts/**,tests/Contracts}/*.sol | xargs shasum -p | shasum -p | cut -d' ' -f 1)"
fi

if [ -z "$rebuild" -a -f "$cache_file" ]; then
cached="$(cat $cache_file)"
Expand Down

0 comments on commit eb7a6c9

Please sign in to comment.