Skip to content

Commit 166eb98

Browse files
committed
update
1 parent c705b77 commit 166eb98

File tree

7 files changed

+50
-176
lines changed

7 files changed

+50
-176
lines changed

avr/postinstall.js

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,17 @@ const os = require('os');
77
// 获取当前操作系统类型
88
function getOSType() {
99
const platform = os.platform();
10-
const arch = os.arch();
11-
12-
let osType = '';
13-
switch (platform) {
14-
case 'win32':
15-
osType = 'Windows';
16-
break;
17-
case 'darwin':
18-
osType = 'macOS';
19-
break;
20-
case 'linux':
21-
osType = 'Linux';
22-
break;
23-
case 'freebsd':
24-
osType = 'FreeBSD';
25-
break;
26-
case 'openbsd':
27-
osType = 'OpenBSD';
28-
break;
29-
case 'sunos':
30-
osType = 'SunOS';
31-
break;
32-
default:
33-
osType = platform;
10+
let arch = os.arch();
11+
12+
// 根据arch判断是intel还是arm架构
13+
if (arch.startsWith('arm')) {
14+
arch = 'arm';
15+
} else {
16+
arch = 'intel';
3417
}
35-
18+
3619
return {
3720
platform: platform,
38-
type: osType,
3921
arch: arch,
4022
release: os.release(),
4123
version: os.version ? os.version() : 'N/A'

ch55x/postinstall.js

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,17 @@ const os = require('os');
88
// 获取当前操作系统类型
99
function getOSType() {
1010
const platform = os.platform();
11-
const arch = os.arch();
12-
13-
let osType = '';
14-
switch (platform) {
15-
case 'win32':
16-
osType = 'Windows';
17-
break;
18-
case 'darwin':
19-
osType = 'macOS';
20-
break;
21-
case 'linux':
22-
osType = 'Linux';
23-
break;
24-
case 'freebsd':
25-
osType = 'FreeBSD';
26-
break;
27-
case 'openbsd':
28-
osType = 'OpenBSD';
29-
break;
30-
case 'sunos':
31-
osType = 'SunOS';
32-
break;
33-
default:
34-
osType = platform;
11+
let arch = os.arch();
12+
13+
// 根据arch判断是intel还是arm架构
14+
if (arch.startsWith('arm')) {
15+
arch = 'arm';
16+
} else {
17+
arch = 'intel';
3518
}
3619

3720
return {
3821
platform: platform,
39-
type: osType,
4022
arch: arch,
4123
release: os.release(),
4224
version: os.version ? os.version() : 'N/A'

esp32/postinstall.js

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,17 @@ const os = require('os');
88
// 获取当前操作系统类型
99
function getOSType() {
1010
const platform = os.platform();
11-
const arch = os.arch();
12-
13-
let osType = '';
14-
switch (platform) {
15-
case 'win32':
16-
osType = 'Windows';
17-
break;
18-
case 'darwin':
19-
osType = 'macOS';
20-
break;
21-
case 'linux':
22-
osType = 'Linux';
23-
break;
24-
case 'freebsd':
25-
osType = 'FreeBSD';
26-
break;
27-
case 'openbsd':
28-
osType = 'OpenBSD';
29-
break;
30-
case 'sunos':
31-
osType = 'SunOS';
32-
break;
33-
default:
34-
osType = platform;
11+
let arch = os.arch();
12+
13+
// 根据arch判断是intel还是arm架构
14+
if (arch.startsWith('arm')) {
15+
arch = 'arm';
16+
} else {
17+
arch = 'intel';
3518
}
3619

3720
return {
3821
platform: platform,
39-
type: osType,
4022
arch: arch,
4123
release: os.release(),
4224
version: os.version ? os.version() : 'N/A'

renesas_uno/postinstall.js

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,17 @@ const os = require('os');
77
// 获取当前操作系统类型
88
function getOSType() {
99
const platform = os.platform();
10-
const arch = os.arch();
11-
12-
let osType = '';
13-
switch (platform) {
14-
case 'win32':
15-
osType = 'Windows';
16-
break;
17-
case 'darwin':
18-
osType = 'macOS';
19-
break;
20-
case 'linux':
21-
osType = 'Linux';
22-
break;
23-
case 'freebsd':
24-
osType = 'FreeBSD';
25-
break;
26-
case 'openbsd':
27-
osType = 'OpenBSD';
28-
break;
29-
case 'sunos':
30-
osType = 'SunOS';
31-
break;
32-
default:
33-
osType = platform;
10+
let arch = os.arch();
11+
12+
// 根据arch判断是intel还是arm架构
13+
if (arch.startsWith('arm')) {
14+
arch = 'arm';
15+
} else {
16+
arch = 'intel';
3417
}
3518

3619
return {
3720
platform: platform,
38-
type: osType,
3921
arch: arch,
4022
release: os.release(),
4123
version: os.version ? os.version() : 'N/A'

rp2040/postinstall.js

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,17 @@ const os = require('os');
77
// 获取当前操作系统类型
88
function getOSType() {
99
const platform = os.platform();
10-
const arch = os.arch();
11-
12-
let osType = '';
13-
switch (platform) {
14-
case 'win32':
15-
osType = 'Windows';
16-
break;
17-
case 'darwin':
18-
osType = 'macOS';
19-
break;
20-
case 'linux':
21-
osType = 'Linux';
22-
break;
23-
case 'freebsd':
24-
osType = 'FreeBSD';
25-
break;
26-
case 'openbsd':
27-
osType = 'OpenBSD';
28-
break;
29-
case 'sunos':
30-
osType = 'SunOS';
31-
break;
32-
default:
33-
osType = platform;
10+
let arch = os.arch();
11+
12+
// 根据arch判断是intel还是arm架构
13+
if (arch.startsWith('arm')) {
14+
arch = 'arm';
15+
} else {
16+
arch = 'intel';
3417
}
3518

3619
return {
3720
platform: platform,
38-
type: osType,
3921
arch: arch,
4022
release: os.release(),
4123
version: os.version ? os.version() : 'N/A'

sam/postinstall.js

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,17 @@ const os = require('os');
88
// 获取当前操作系统类型
99
function getOSType() {
1010
const platform = os.platform();
11-
const arch = os.arch();
12-
13-
let osType = '';
14-
switch (platform) {
15-
case 'win32':
16-
osType = 'Windows';
17-
break;
18-
case 'darwin':
19-
osType = 'macOS';
20-
break;
21-
case 'linux':
22-
osType = 'Linux';
23-
break;
24-
case 'freebsd':
25-
osType = 'FreeBSD';
26-
break;
27-
case 'openbsd':
28-
osType = 'OpenBSD';
29-
break;
30-
case 'sunos':
31-
osType = 'SunOS';
32-
break;
33-
default:
34-
osType = platform;
11+
let arch = os.arch();
12+
13+
// 根据arch判断是intel还是arm架构
14+
if (arch.startsWith('arm')) {
15+
arch = 'arm';
16+
} else {
17+
arch = 'intel';
3518
}
3619

3720
return {
3821
platform: platform,
39-
type: osType,
4022
arch: arch,
4123
release: os.release(),
4224
version: os.version ? os.version() : 'N/A'

stm32/postinstall.js

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,17 @@ const os = require('os');
77
// 获取当前操作系统类型
88
function getOSType() {
99
const platform = os.platform();
10-
const arch = os.arch();
11-
12-
let osType = '';
13-
switch (platform) {
14-
case 'win32':
15-
osType = 'Windows';
16-
break;
17-
case 'darwin':
18-
osType = 'macOS';
19-
break;
20-
case 'linux':
21-
osType = 'Linux';
22-
break;
23-
case 'freebsd':
24-
osType = 'FreeBSD';
25-
break;
26-
case 'openbsd':
27-
osType = 'OpenBSD';
28-
break;
29-
case 'sunos':
30-
osType = 'SunOS';
31-
break;
32-
default:
33-
osType = platform;
10+
let arch = os.arch();
11+
12+
// 根据arch判断是intel还是arm架构
13+
if (arch.startsWith('arm')) {
14+
arch = 'arm';
15+
} else {
16+
arch = 'intel';
3417
}
3518

3619
return {
3720
platform: platform,
38-
type: osType,
3921
arch: arch,
4022
release: os.release(),
4123
version: os.version ? os.version() : 'N/A'

0 commit comments

Comments
 (0)