forked from github/vscode-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·31 lines (25 loc) · 941 Bytes
/
bootstrap
File metadata and controls
executable file
·31 lines (25 loc) · 941 Bytes
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
#!/bin/bash
set -e
function clone_repo() {
GREEN='\033[0;32m'
REPOSITORY_URL=$1
REPOSITORY_PATH=$2
if [[ ! -d "$REPOSITORY_PATH/.git" ]]; then
echo -e "\n${GREEN}➡️ Cloning $REPOSITORY_URL...\n${NC}"
git clone "$REPOSITORY_URL" "$REPOSITORY_PATH"
fi
}
repo_root="$(git rev-parse --show-toplevel)"
root="$(dirname "$repo_root")"
# Copy working package-lock.json to workspace
echo "Copy lock file to workspace..."
cp "$repo_root"/script/workspace/package-lock.json "$root"
# Clone dependent repos
echo "Cloning dependent repos..."
clone_repo https://github.com/actions/languageservices "$root"/languageservices
# Copy workspace files
echo "Copying workspace files..."
cp "$repo_root"/script/workspace/package.json "$root"
cp "$repo_root"/script/workspace/vscode-github-actions.code-workspace "$root"
cp "$repo_root"/script/workspace/update-package-locks.sh "$root"
cp "$repo_root"/script/workspace/watch.sh "$root"