forked from VSCodium/vscodium
-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
win7_patch.sh
executable file
·61 lines (45 loc) · 1.65 KB
/
win7_patch.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
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# shellcheck disable=SC2129
set -e
# Copyright(c) 2024 Alex313031
YEL='\033[1;33m' # Yellow
CYA='\033[1;96m' # Cyan
RED='\033[1;31m' # Red
GRE='\033[1;32m' # Green
c0='\033[0m' # Reset Text
bold='\033[1m' # Bold Text
underline='\033[4m' # Underline Text
# --help
displayHelp () {
printf "\n" &&
printf "${bold}${GRE}Script to patch Codium for Windows NT 6.x and Ubuntu 18.04/Debian 9${c0}\n" &&
printf "${bold}${YEL}Use ./macos_patch.sh for MacOS.${c0}\n" &&
printf "${bold}${YEL}Use the --help flag to show this help.${c0}\n" &&
printf "\n"
}
case $1 in
--help) displayHelp; exit 0;;
esac
cd ./vscode || { printf "\n${RED}Error: 'vscode' dir not found\n\n"; exit 1; }
clear &&
printf "\n" &&
printf "${GRE}Patching vscode for Windows NT 6.x...${c0}\n" &&
printf "\n" &&
# Make patch
# git diff > ../nt6.patch
git apply --reject ../nt6.patch &&
printf "\n" &&
printf "${GRE}Patching vscode for 32-bit Windows...${c0}\n" &&
printf "\n" &&
git apply --reject ../win32-ia32.patch &&
printf "\n" &&
printf "${GRE}Patching vscode for Ubuntu 18.04/Debian 9...${c0}\n" &&
printf "\n" &&
git apply --reject ../bionic.patch &&
/usr/bin/find ./ \( -type d -name .git -prune -type d -name node_modules -prune \) -o -type f -name package.json -print0 | xargs -0 sed -i 's/\"\@types\/node\"\:\ \"20\.x\"/\"\@types\/node\"\:\ \"18\.19\.53\"/g' &&
/usr/bin/find ./ \( -type d -name .git -prune -type d -name node_modules -prune \) -o -type f -name package.json -print0 | xargs -0 sed -i 's/\"node\"\:\ \"20\.x\"/\"node\"\:\ \"18\.x\"/g' &&
cd .. &&
printf "\n" &&
printf "${GRE}Patched for Windows NT 6.x and Ubuntu 18.04/Debian 9!\n" &&
printf "\n" &&
tput sgr0