Skip to content

Commit

Permalink
Merge branch 'refs/heads/releases/v1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Conventional Changelog Action committed May 9, 2024
2 parents 99da492 + e64eec5 commit 3477ca4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Open `powershell` and run the following command. This will start setting up your

<!-- WINDOWS_LINK_X64_START -->
```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"
```
<!-- WINDOWS_LINK_X64_END -->

Expand All @@ -47,15 +47,15 @@ For Mac users, the process is just as simple. Depending on the type of chip your

<!-- MACOS_LINK_X64_START -->
```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
```
<!-- MACOS_LINK_X64_END -->

- If you have a newer Mac model with Apple's own chip (like the M1 or M2, found in Macs from late 2020 onwards):

<!-- MACOS_LINK_ARM64_START -->
```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
```
<!-- MACOS_LINK_ARM64_END -->

Expand All @@ -65,7 +65,7 @@ For Linux users running Ubuntu 18.04 LTS or newer versions, execute the followin

<!-- LINUX_LINK_X64_START -->
```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
```
<!-- LINUX_LINK_X64_END -->

Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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** |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leoli0605/env-setup",
"version": "1.2.1",
"version": "1.2.2",
"description": "\"\"",
"main": "./src/index.mjs",
"files": [
Expand Down
11 changes: 1 addition & 10 deletions packageData.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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": {
Expand Down
19 changes: 9 additions & 10 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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();
Expand All @@ -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');
Expand Down

0 comments on commit 3477ca4

Please sign in to comment.