sandboxbox 2.0.2 → 2.0.4
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/cli.js +26 -4
- package/package.json +1 -1
- package/scripts/download-podman.js +6 -3
- package/bin/podman-remote-static-linux_amd64 +0 -0
package/cli.js
CHANGED
@@ -69,6 +69,7 @@ function showHelp() {
|
|
69
69
|
function getPodmanPath() {
|
70
70
|
// Check for bundled podman first
|
71
71
|
const platform = process.platform;
|
72
|
+
const arch = process.arch === 'arm64' ? 'arm64' : 'amd64';
|
72
73
|
let bundledPodman;
|
73
74
|
|
74
75
|
if (platform === 'win32') {
|
@@ -76,7 +77,7 @@ function getPodmanPath() {
|
|
76
77
|
} else if (platform === 'darwin') {
|
77
78
|
bundledPodman = resolve(__dirname, 'bin', 'podman');
|
78
79
|
} else {
|
79
|
-
bundledPodman = resolve(__dirname, 'bin',
|
80
|
+
bundledPodman = resolve(__dirname, 'bin', `podman-remote-static-linux_${arch}`);
|
80
81
|
}
|
81
82
|
|
82
83
|
if (existsSync(bundledPodman)) {
|
@@ -95,9 +96,30 @@ function checkPodman() {
|
|
95
96
|
console.log(color('green', `✅ ${version}${isBundled ? ' (bundled)' : ''}`));
|
96
97
|
return podmanPath;
|
97
98
|
} catch (error) {
|
98
|
-
|
99
|
-
|
100
|
-
|
99
|
+
// If no bundled Podman and system Podman not found, try to download
|
100
|
+
if (!isBundled && !existsSync(podmanPath)) {
|
101
|
+
console.log(color('red', '❌ Podman not found'));
|
102
|
+
console.log(color('yellow', '\n📦 Auto-downloading Podman...'));
|
103
|
+
|
104
|
+
try {
|
105
|
+
// Run the download script directly
|
106
|
+
const scriptPath = resolve(__dirname, 'scripts', 'download-podman.js');
|
107
|
+
execSync(`node "${scriptPath}"`, { stdio: 'inherit', cwd: __dirname });
|
108
|
+
|
109
|
+
// Try again with downloaded Podman
|
110
|
+
const newPodmanPath = getPodmanPath();
|
111
|
+
const version = execSync(`"${newPodmanPath}" --version`, { encoding: 'utf-8', stdio: 'pipe' }).trim();
|
112
|
+
console.log(color('green', `\n✅ ${version} (auto-downloaded)`));
|
113
|
+
return newPodmanPath;
|
114
|
+
} catch (downloadError) {
|
115
|
+
console.log(color('red', `\n❌ Auto-download failed: ${downloadError.message}`));
|
116
|
+
console.log(color('yellow', '\n💡 Please install Podman manually:'));
|
117
|
+
}
|
118
|
+
} else {
|
119
|
+
console.log(color('red', '❌ Podman not found'));
|
120
|
+
console.log(color('yellow', '\n💡 Please install Podman manually:'));
|
121
|
+
}
|
122
|
+
|
101
123
|
console.log('');
|
102
124
|
if (process.platform === 'win32') {
|
103
125
|
console.log(color('cyan', ' Windows:'));
|
package/package.json
CHANGED
@@ -19,6 +19,9 @@ const binDir = join(__dirname, '..', 'bin');
|
|
19
19
|
// Podman remote client versions
|
20
20
|
const PODMAN_VERSION = '4.9.3';
|
21
21
|
|
22
|
+
// Get architecture
|
23
|
+
const ARCH = process.arch === 'arm64' ? 'arm64' : 'amd64';
|
24
|
+
|
22
25
|
const DOWNLOADS = {
|
23
26
|
win32: {
|
24
27
|
url: `https://github.com/containers/podman/releases/download/v${PODMAN_VERSION}/podman-remote-release-windows_amd64.zip`,
|
@@ -26,13 +29,13 @@ const DOWNLOADS = {
|
|
26
29
|
extract: 'unzip'
|
27
30
|
},
|
28
31
|
darwin: {
|
29
|
-
url: `https://github.com/containers/podman/releases/download/v${PODMAN_VERSION}/podman-remote-release-
|
32
|
+
url: `https://github.com/containers/podman/releases/download/v${PODMAN_VERSION}/podman-remote-release-darwin_${ARCH}.tar.gz`,
|
30
33
|
binary: 'podman',
|
31
34
|
extract: 'tar'
|
32
35
|
},
|
33
36
|
linux: {
|
34
|
-
url: `https://github.com/containers/podman/releases/download/v${PODMAN_VERSION}/podman-remote-static-
|
35
|
-
binary:
|
37
|
+
url: `https://github.com/containers/podman/releases/download/v${PODMAN_VERSION}/podman-remote-static-linux_${ARCH}.tar.gz`,
|
38
|
+
binary: `podman-remote-static-linux_${ARCH}`,
|
36
39
|
extract: 'tar'
|
37
40
|
}
|
38
41
|
};
|
Binary file
|