@offckb/cli 0.1.0-rc8 → 0.1.1-canary-79abb13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -0
- package/dist/cmd/install.js +1 -1
- package/dist/encoding.d.ts +1 -0
- package/dist/encoding.js +19 -0
- package/dist/util.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -20,7 +20,10 @@ const build_lumos_config_1 = require("./cmd/build-lumos-config");
|
|
|
20
20
|
const init_1 = require("./cmd/init");
|
|
21
21
|
const accounts_1 = require("./cmd/accounts");
|
|
22
22
|
const clean_1 = require("./cmd/clean");
|
|
23
|
+
const encoding_1 = require("./encoding");
|
|
23
24
|
const version = require('../package.json').version;
|
|
25
|
+
// fix windows terminal encoding of simplified chinese text
|
|
26
|
+
(0, encoding_1.setUTF8EncodingForWindows)();
|
|
24
27
|
const program = new commander_1.Command();
|
|
25
28
|
program
|
|
26
29
|
.name('offckb')
|
package/dist/cmd/install.js
CHANGED
|
@@ -104,7 +104,7 @@ function unZipFile(filePath, extractDir, useTar = false) {
|
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
105
|
// Ensure the destination directory exists, if not create it
|
|
106
106
|
if (!fs.existsSync(extractDir)) {
|
|
107
|
-
fs.mkdirSync(extractDir);
|
|
107
|
+
fs.mkdirSync(extractDir, { recursive: true });
|
|
108
108
|
}
|
|
109
109
|
if (useTar === true) {
|
|
110
110
|
return yield decompressTarGzAsync(filePath, extractDir);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setUTF8EncodingForWindows(): void;
|
package/dist/encoding.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setUTF8EncodingForWindows = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
function setUTF8EncodingForWindows() {
|
|
10
|
+
if (os_1.default.platform() === 'win32') {
|
|
11
|
+
try {
|
|
12
|
+
(0, child_process_1.execSync)('chcp 65001');
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error('Failed to set UTF-8 encoding for Windows terminal.', error.message);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.setUTF8EncodingForWindows = setUTF8EncodingForWindows;
|
package/dist/util.js
CHANGED
|
@@ -58,7 +58,7 @@ function isFolderExists(folderPath) {
|
|
|
58
58
|
exports.isFolderExists = isFolderExists;
|
|
59
59
|
function copyFolderSync(source, destination) {
|
|
60
60
|
if (!fs.existsSync(destination)) {
|
|
61
|
-
fs.mkdirSync(destination);
|
|
61
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
62
62
|
}
|
|
63
63
|
const files = fs.readdirSync(source);
|
|
64
64
|
for (const file of files) {
|