Skip to content

Commit 3b29c4c

Browse files
committed
chore: add storage export command
Signed-off-by: Alex Chi <[email protected]>
1 parent 925821d commit 3b29c4c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

scripts/update-storage-tutorial.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
6+
7+
TEMP_DIR=$(mktemp -d "/tmp/risinglight-tutorial.XXXXXX")
8+
CHECKOUT_AT="${TEMP_DIR}/checkout"
9+
10+
cd "$DIR/.."
11+
12+
rm -rf "code/03-00"
13+
rm -rf "code/03-01"
14+
15+
git worktree prune
16+
17+
git worktree add "${CHECKOUT_AT}" storage --detach
18+
cp -a "${CHECKOUT_AT}/code/03-00/" "code/03-01"
19+
sed -i ".bak" -e "s/risinglight-03-00/risinglight-03-01/g" "code/03-01/Cargo.toml"
20+
sed -i ".bak" -e "s/risinglight_03_00/risinglight_03_01/g" "code/03-01/src/main.rs"
21+
rm "code/03-01/Cargo.toml.bak"
22+
rm "code/03-01/src/main.rs.bak"
23+
git worktree remove "${CHECKOUT_AT}"
24+
25+
git worktree add "${CHECKOUT_AT}" storage~1 --detach
26+
cp -a "${CHECKOUT_AT}/code/03-00/" "code/03-00"
27+
git worktree remove "${CHECKOUT_AT}"

0 commit comments

Comments
 (0)