Skip to content

Commit

Permalink
refactor: test contract build script $PWD agnostic (near#5815)
Browse files Browse the repository at this point in the history
The scripts runs a couple of dangerous commands (such as `rm -rf`) with
relative directory arguments. This can result in an unintended data
loss. Make sure the script has $PWD set to an expected location before
doing anything else.
  • Loading branch information
nagisa authored Dec 13, 2021
1 parent 376791e commit e7e9fbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/runtime-params-estimator/test-contract/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env bash
set -ex

# Make sure we're executing from the directory with the contract (this script invokes
# $PWD-sensitive commands)
cd "$(dirname $0)"

features_with_arg=""
features_with_comma=""

Expand Down

0 comments on commit e7e9fbc

Please sign in to comment.