-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathsync-examples.sh
More file actions
executable file
·49 lines (40 loc) · 2.6 KB
/
Copy pathsync-examples.sh
File metadata and controls
executable file
·49 lines (40 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# This script copies the public integration tests from ink! over
# and replaces the relatives paths to ink! crates.
# Path to a local copy of the ink! repostiory.
INK_PROJECT_FOLDER="../ink"
# What to substitute the relative `path = "../"` with.
INK_SUBSTITUTION='version = "6.0.0-beta.1"'
INK_E2E_SUBSTITUTION='version = "6.0.0-beta.1"'
INK_PRECOMPILES_SUBSTITUTION='version = "6.0.0-beta.1"'
INK_SANDBOX_SUBSTITUTION='git = "https://github.com/use-ink/ink", branch = "6.0.0-beta.1"'
# Clean all examples first, if there are still `target` folders the copy
# will take ages.
fd Cargo.toml $INK_PROJECT_FOLDER/integration-tests/public/ |
xargs -n1 -I{} bash -c "echo {}; cargo clean --manifest-path={}"
/bin/cp -rf $INK_PROJECT_FOLDER/integration-tests/public/* .
# Find all `Cargo.toml` files and replace the `path`
find . -name "Cargo.toml" -type f | while read -r file; do
# replace `ink`
perl -pi -e "s|path = \"./\.\./crates/ink\"|$INK_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\./\.\./crates/ink\"|$INK_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\./\.\./crates/ink\"|$INK_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\.\/\.\./\.\./crates/ink\"|$INK_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\.\/\.\.\/\.\./\.\./crates/ink\"|$INK_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\.\/\.\.\/\.\.\/\.\./\.\./crates/ink\"|$INK_SUBSTITUTION|" "$file"
# replace `ink_sandbox`
perl -pi -e "s|path = \"\.\.\/\.\./\.\.\/\.\./\.\.\/\.\./crates/sandbox\"|$INK_SANDBOX_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\./\.\.\/\.\./\.\.\/\.\./crates/sandbox\"|$INK_SANDBOX_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\./\.\.\/\.\./crates/sandbox\"|$INK_SANDBOX_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\./\.\.\/\.\./crates/sandbox\"|$INK_SANDBOX_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\./crates/sandbox\"|$INK_SANDBOX_SUBSTITUTION|" "$file"
# replace `ink_e2e`
perl -pi -e "s|path = \"./\.\./crates/e2e\"|$INK_E2E_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\./\.\./crates/e2e\"|$INK_E2E_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\./\.\./crates/e2e\"|$INK_E2E_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\.\/\.\./\.\./crates/e2e\"|$INK_E2E_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\.\/\.\.\/\.\./\.\./crates/e2e\"|$INK_E2E_SUBSTITUTION|" "$file"
perl -pi -e "s|path = \"\.\.\/\.\.\/\.\.\/\.\.\/\.\./\.\./crates/e2e\"|$INK_E2E_SUBSTITUTION|" "$file"
# replace `ink_precompiles`
perl -pi -e "s|path = \"./\.\./crates/precompiles\"|$INK_PRECOMPILES_SUBSTITUTION|" "$file"
done