-
Notifications
You must be signed in to change notification settings - Fork 37
/
link.sh
executable file
·48 lines (43 loc) · 959 Bytes
/
link.sh
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
#!/bin/bash
# Generate all the symlinks for each child directory.
set -e
# Change to our project home.
script_dir=$(dirname "${BASH_SOURCE[0]}")
script_home=$(realpath "${script_dir}")
cd "${script_home}"/..
WORKSPACES=(
"lexical"
"lexical-core"
"lexical-parse-float"
"lexical-parse-integer"
"lexical-write-float"
"lexical-write-integer"
"lexical-util"
)
WORKSPACE_FILES=(
"CODE_OF_CONDUCT.md"
"LICENSE-APACHE"
"LICENSE-MIT"
"README.md"
)
for workspace in "${WORKSPACES[@]}"; do
for file in "${WORKSPACE_FILES[@]}"; do
unlink "$workspace/$file"
ln -s ../"$file" "$workspace/$file"
done
done
PROJECTS=(
"lexical-asm"
"lexical-benchmark"
"lexical-size"
)
PROJECT_FILES=(
"clippy.toml"
"rustfmt.toml"
)
for project in "${PROJECTS[@]}"; do
for file in "${PROJECT_FILES[@]}"; do
unlink "$project/$file"
ln -s ../"$file" "$project/$file"
done
done