File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ apply_changes () {
6+
7+ # Use custom path if provided, otherwise default to ./vscode
8+ local patched_src_dir=" ${1:- $(pwd)/ vscode} "
9+ echo " Creating patched source in directory: ${patched_src_dir} "
10+
11+ code_editor_module_path=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /.." && pwd) "
12+ patch_dir=" ${code_editor_module_path} /patches"
13+
14+ export QUILT_PATCHES=" ${patch_dir} "
15+ export QUILT_SERIES=" web-server.series"
16+
17+ # Clean out the build directory
18+ echo " Cleaning build src dir"
19+ rm -rf " ${patched_src_dir} "
20+
21+ # Copy third party source
22+ rsync -a " ${code_editor_module_path} /third-party-src/" " ${patched_src_dir} "
23+
24+ echo " Applying base patches"
25+ pushd " ${patched_src_dir} "
26+ quilt push -a
27+ popd
28+
29+ echo " Applying overrides"
30+ rsync -a " ${code_editor_module_path} /overrides/" " ${patched_src_dir} "
31+
32+ }
33+
34+ custom_path=" "
35+ while [[ $# -gt 0 ]]; do
36+ case $1 in
37+ --path)
38+ if [[ -z " ${2:- } " ]]; then
39+ echo " Error: --path requires a value"
40+ exit 1
41+ fi
42+ custom_path=" $2 "
43+ shift 2
44+ ;;
45+ -h|--help)
46+ echo " Usage: $0 [--path <directory>]"
47+ echo " --path: Custom build directory (default: ./vscode)"
48+ exit 0
49+ ;;
50+ * )
51+ echo " Invalid parameter - '$1 '"
52+ echo " Use --help for usage information"
53+ exit 1
54+ ;;
55+ esac
56+ done
57+ apply_changes " ${custom_path} "
You can’t perform that action at this time.
0 commit comments