Skip to content

Commit 7da6f9c

Browse files
committed
experiment with justfile()
1 parent 0a72d35 commit 7da6f9c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

examples/justfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,23 @@ bulletin-solo-zombienet-start runtime="bulletin-polkadot-runtime":
110110

111111
# Create chain spec
112112
echo " Creating Westend chain spec..."
113+
ROOT_DIR="{{ justfile_directory() }}/.."
113114
# Ensure binaries are in PATH for the script
114-
export PATH="~/local_bulletin_testing/bin:$PATH"
115-
(cd .. && PATH="$HOME/local_bulletin_testing/bin:$PATH" ./scripts/create_bulletin_westend_spec.sh)
115+
PATH="$HOME/local_bulletin_testing/bin:$PATH" $ROOT_DIR/scripts/create_bulletin_westend_spec.sh
116116

117117
# Run zombienet from root directory so relative paths in config work correctly
118-
ZOMBIENET_CONFIG=$(cd .. && pwd)/zombienet/bulletin-westend-local.toml
119118
mkdir -p {{ ZOMBIENET_DIR }}
120-
(cd .. && POLKADOT_BINARY_PATH=$POLKADOT_BINARY_PATH \
119+
(cd "$ROOT_DIR" && POLKADOT_BINARY_PATH=$POLKADOT_BINARY_PATH \
121120
POLKADOT_PARACHAIN_BINARY_PATH=$POLKADOT_PARACHAIN_BINARY_PATH \
122-
$ZOMBIENET_BIN -p native spawn --dir {{ ZOMBIENET_DIR }} $ZOMBIENET_CONFIG > {{ ZOMBIENET_DIR }}/zombienet.log 2>&1) &
121+
$ZOMBIENET_BIN -p native spawn --dir {{ ZOMBIENET_DIR }} "$ROOT_DIR/zombienet/bulletin-westend-local.toml" > {{ ZOMBIENET_DIR }}/zombienet.log 2>&1) &
123122
else # bulletin-polkadot-runtime
124123
echo " Setting up Polkadot runtime..."
124+
ROOT_DIR="{{ justfile_directory() }}/.."
125125
# Build the node binary (which will build the runtime as a dependency)
126126
cargo build --release -p polkadot-bulletin-chain
127-
BULLETIN_BINARY=$(cd .. && pwd)/target/release/polkadot-bulletin-chain
128-
ZOMBIENET_CONFIG=$(cd .. && pwd)/zombienet/bulletin-polkadot-local.toml
129127
mkdir -p {{ ZOMBIENET_DIR }}
130-
(cd .. && POLKADOT_BULLETIN_BINARY_PATH=$BULLETIN_BINARY $ZOMBIENET_BIN -p native spawn --dir {{ ZOMBIENET_DIR }} $ZOMBIENET_CONFIG > {{ ZOMBIENET_DIR }}/zombienet.log 2>&1) &
128+
(cd "$ROOT_DIR" && POLKADOT_BULLETIN_BINARY_PATH="$ROOT_DIR/target/release/polkadot-bulletin-chain" \
129+
$ZOMBIENET_BIN -p native spawn --dir {{ ZOMBIENET_DIR }} "$ROOT_DIR/zombienet/bulletin-polkadot-local.toml" > {{ ZOMBIENET_DIR }}/zombienet.log 2>&1) &
131130
fi
132131
ZOMBIENET_PID=$!
133132
echo $ZOMBIENET_PID > {{ PID_DIR }}/zombienet.pid

0 commit comments

Comments
 (0)