From b5ad835f50c2664f94ef227178e77dbbe3be9c0d Mon Sep 17 00:00:00 2001 From: Tw93 Date: Mon, 28 Aug 2023 18:38:47 +0800 Subject: [PATCH] :bug: fix download icon --- script/build_with_pake_cli.mjs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/script/build_with_pake_cli.mjs b/script/build_with_pake_cli.mjs index 98ebbb4..582241c 100644 --- a/script/build_with_pake_cli.mjs +++ b/script/build_with_pake_cli.mjs @@ -1,7 +1,6 @@ import shelljs from 'shelljs'; import axios from 'axios'; import fs from 'fs'; -import os from 'os'; import { fileURLToPath } from 'url'; import path, { dirname } from 'path'; @@ -31,19 +30,19 @@ let params = `node cli.js ${process.env.URL} --name ${process.env.NAME}`; // Download Icons if (process.env.ICON && process.env.ICON !== '') { let iconFile; - switch (os.type()) { - case 'Linux': + switch (process.platform) { + case 'linux': iconFile = 'icon.png'; break; - case 'Darwin': + case 'darwin': iconFile = 'icon.icns'; break; - case 'Windows_NT': + case 'win32': iconFile = 'icon.ico'; break; default: console.log("Unable to detect your OS system, won't download the icon!"); - return; + process.exit(1); } axios