diff --git a/CHANGELOG.md b/CHANGELOG.md index 55f6543..ec6696a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [1.2.2](https://github.com/leoli0605/npm-env-setup/compare/v1.2.1...v1.2.2) (2024-05-09) + + +### Bug Fixes + +* fix some critical error ([71e0a5b](https://github.com/leoli0605/npm-env-setup/commit/71e0a5b43ea709b47f4391c80db14f1e51977da3)) + + + ## [1.2.1](https://github.com/leoli0605/npm-env-setup/compare/v1.2.0...v1.2.1) (2024-05-09) diff --git a/README.md b/README.md index e2f8e54..4730d13 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Open `powershell` and run the following command. This will start setting up your ```shell -powershell.exe -Command "Invoke-WebRequest -Uri https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.1/env-setup-win-x64.exe -OutFile env-setup-win-x64.exe; Start-Process env-setup-win-x64.exe -Wait; Remove-Item env-setup-win-x64.exe -Force" +powershell.exe -Command "Invoke-WebRequest -Uri https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.2/env-setup-win-x64.exe -OutFile env-setup-win-x64.exe; Start-Process env-setup-win-x64.exe -Wait; Remove-Item env-setup-win-x64.exe -Force" ``` @@ -47,7 +47,7 @@ For Mac users, the process is just as simple. Depending on the type of chip your ```shell -curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.1/env-setup-macos-x64 -o env-setup-macos-x64 && chmod +x env-setup-macos-x64 && ./env-setup-macos-x64 && rm -f env-setup-macos-x64 +curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.2/env-setup-macos-x64 -o env-setup-macos-x64 && chmod +x env-setup-macos-x64 && ./env-setup-macos-x64 && rm -f env-setup-macos-x64 ``` @@ -55,7 +55,7 @@ curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.1/env- ```shell -curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.1/env-setup-macos-arm64 -o env-setup-macos-arm64 && chmod +x env-setup-macos-arm64 && ./env-setup-macos-arm64 && rm -f env-setup-macos-arm64 +curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.2/env-setup-macos-arm64 -o env-setup-macos-arm64 && chmod +x env-setup-macos-arm64 && ./env-setup-macos-arm64 && rm -f env-setup-macos-arm64 ``` @@ -65,7 +65,7 @@ For Linux users running Ubuntu 18.04 LTS or newer versions, execute the followin ```shell -curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.1/env-setup-linux-x64 -o env-setup-linux-x64 && chmod +x env-setup-linux-x64 && ./env-setup-linux-x64 && rm -f env-setup-linux-x64 +curl -L https://github.com/leoli0605/npm-env-setup/releases/download/v1.2.2/env-setup-linux-x64 -o env-setup-linux-x64 && chmod +x env-setup-linux-x64 && ./env-setup-linux-x64 && rm -f env-setup-linux-x64 ``` @@ -133,7 +133,6 @@ Additionally, it sets up some useful programming tools and utilities, ensuring t | Folder Size | 資料夾大小檢視工具 | disable | | Google Drive | - | **enable** | | Hugo | 靜態網站產生器 | **enable** | -| ImageMagick | 圖像處理工具 | **enable** | | Inkscape | 免費向量繪圖軟體,類似 Adobe Illustrator | disable | | Keyviz | 按鍵可視化工具,它可以實時顯示用戶當前按下的按鍵。 | **enable** | | Krita | 免費的數位繪圖軟體,類似 Adobe Photoshop | disable | @@ -194,7 +193,6 @@ Additionally, it sets up some useful programming tools and utilities, ensuring t | Fira Code | 好看的程式碼字型 | `force` | | Google Drive | - | **enable** | | Hugo | 靜態網站產生器 | **enable** | -| ImageMagick | 圖像處理工具 | **enable** | | Inkscape | 免費向量繪圖軟體,類似 Adobe Illustrator | disable | | Krita | 免費的數位繪圖軟體,類似 Adobe Photoshop | disable | | Logi Options+ | - | disable | @@ -242,7 +240,6 @@ Additionally, it sets up some useful programming tools and utilities, ensuring t | minicom | Linux/Unix 系統的終端機通訊程式 | **enable** | | pyOCD | Python OpenOCD | **enable** | | Hugo | 靜態網站產生器 | **enable** | -| ImageMagick | 圖像處理工具 | **enable** | | Inkscape | 免費向量繪圖軟體,類似 Adobe Illustrator | disable | | Noto Sans CJK | Google 開發的中文字型 | **enable** | | OBS Studio | 開源的串流軟體 | **enable** | diff --git a/package.json b/package.json index ec1948d..c277d47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@leoli0605/env-setup", - "version": "1.2.1", + "version": "1.2.2", "description": "\"\"", "main": "./src/index.mjs", "files": [ diff --git a/packageData.json b/packageData.json index d2c720e..04e8c85 100644 --- a/packageData.json +++ b/packageData.json @@ -138,7 +138,7 @@ "Node.js": { "description": "", "install": { - "linux": "asdf plugin add nodejs && asdf install nodejs 16.20.2 && asdf global nodejs 16.20.2", + "linux": "asdf plugin add nodejs && asdf install nodejs 18.18.0 && asdf global nodejs 18.18.0", "mac": "asdf plugin add nodejs && asdf install nodejs 18.18.0 && asdf global nodejs 18.18.0", "windows": "choco install nodejs --version=18.18.0 -y ; choco pin add -n=nodejs" }, @@ -506,15 +506,6 @@ }, "type": "enable" }, - "ImageMagick": { - "description": "圖像處理工具", - "install": { - "linux": "asdf plugin add imagemagick && asdf install imagemagick latest && asdf global imagemagick latest", - "mac": "asdf plugin add imagemagick && asdf install imagemagick latest && asdf global imagemagick latest", - "windows": "choco install imagemagick -y" - }, - "type": "enable" - }, "Inkscape": { "description": "免費向量繪圖軟體,類似 Adobe Illustrator", "install": { diff --git a/src/index.mjs b/src/index.mjs index 666e4e4..75ec602 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -42,10 +42,6 @@ class SetupManager { this.setupNonWindowsEnvironment(); } - selectedPackages.forEach((p) => p && this.shell.addCommand(p.installCommand)); - - this.refreshEnvironment(); - if (selectedPackages.some((p) => p && p.packageName.startsWith('Python'))) { if (os.platform() === 'win32') { this.shell.addEnvironment('$HOME\\AppData\\Roaming\\Python\\Scripts'); @@ -72,12 +68,11 @@ class SetupManager { if (selectedPackages.some((p) => p && p.packageName.startsWith('Node.js'))) { if (os.platform() === 'linux' && fs.existsSync('/etc/os-release')) { const data = fs.readFileSync('/etc/os-release', 'utf8'); - if (/VERSION_ID="20\.\d+"|VERSION_ID="2[1-9]\.\d+"/.test(data) || /PRETTY_NAME="Ubuntu 20\.\d+.*"|PRETTY_NAME="Ubuntu 2[1-9]\.\d+.*"/.test(data)) { - console.log('Ubuntu 20.04 detected'); - this.shell.addCommand('asdf install nodejs 18.18.0'); - this.shell.addCommand('asdf global nodejs 18.18.0'); - } else { - console.log('Ubuntu 20.04 not detected'); + const isUbuntuVersion2X = /VERSION_ID="20\.\d+"|VERSION_ID="2[1-9]\.\d+"/.test(data) || /PRETTY_NAME="Ubuntu 20\.\d+.*"|PRETTY_NAME="Ubuntu 2[1-9]\.\d+.*"/.test(data); + if (!isUbuntuVersion2X) { + console.log('Ubuntu 2x.xx not detected'); + this.shell.addCommand('asdf install nodejs 16.20.2'); + this.shell.addCommand('asdf global nodejs 16.20.2'); } } this.refreshEnvironment(); @@ -87,6 +82,10 @@ class SetupManager { this.refreshEnvironment(); } + selectedPackages.forEach((p) => p && this.shell.addCommand(p.installCommand)); + + this.refreshEnvironment(); + if (os.platform() === 'win32' && selectedPackages.some((p) => p && p.packageName.startsWith('Sublime Text'))) { this.shell.addCommand(fs.readFileSync(path.join(__dirname, 'scripts/windows/SublimeSetup.ps1'), 'utf8').trim().replace('${PATH}', path.join(__dirname, 'scripts/windows/Preferences.sublime-settings'))); this.shell.addCommand('refreshenv\n');