d18ada4ee7
Docker Publish / docker (web, apps/web/Dockerfile, web) (push) Failing after 0s
Docker Publish / docker (api, apps/api/Dockerfile, api) (push) Failing after 1s
Publish Extension / detect-version (push) Has been skipped
Publish Extension / submit (push) Has been cancelled
29 lines
753 B
JavaScript
29 lines
753 B
JavaScript
/**
|
|
* 设置控制台编码为 UTF-8,解决中文乱码问题
|
|
* 这个脚本在 Windows 上设置控制台代码页为 UTF-8
|
|
*/
|
|
|
|
const { exec } = require('node:child_process')
|
|
const os = require('node:os')
|
|
|
|
if (os.platform() === 'win32') {
|
|
console.log('Setting console encoding to UTF-8...')
|
|
|
|
// 设置控制台代码页为 UTF-8 (65001)
|
|
exec('chcp 65001', (error, stdout, stderr) => {
|
|
if (error) {
|
|
console.warn('Failed to set console code page:', error)
|
|
return
|
|
}
|
|
|
|
if (stderr) {
|
|
console.warn('Console code page setting warning:', stderr)
|
|
}
|
|
|
|
console.log('Console encoding set to UTF-8')
|
|
console.log('Output:', stdout)
|
|
})
|
|
} else {
|
|
console.log('Not on Windows, no console encoding change needed')
|
|
}
|