File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
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} "
You can’t perform that action at this time.
0 commit comments