sshifu 0.7.8-test.6 → 0.7.8-test.8
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/package.json +1 -1
- package/scripts/install.js +12 -1
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -90,15 +90,26 @@ async function main() {
|
|
|
90
90
|
try {
|
|
91
91
|
await download(archiveUrl, archivePath);
|
|
92
92
|
|
|
93
|
+
// Small delay to ensure file handle is released
|
|
94
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
95
|
+
|
|
93
96
|
// Extract the archive
|
|
94
97
|
console.log(`[sshifu] Extracting...`);
|
|
95
98
|
const archiveBinName = `${PACKAGE_NAME}-${platform}${isWindows ? '.exe' : ''}`;
|
|
96
99
|
const extractedPath = path.join(binDir, archiveBinName);
|
|
97
100
|
if (isWindows) {
|
|
98
101
|
try {
|
|
99
|
-
|
|
102
|
+
// Use PowerShell with explicit error action and output redirection
|
|
103
|
+
const psCommand = `Expand-Archive -Path '${archivePath.replace(/'/g, "''")}' -DestinationPath '${binDir.replace(/'/g, "''")}' -Force -ErrorAction Stop`;
|
|
104
|
+
console.log(`[sshifu] Running: ${psCommand}`);
|
|
105
|
+
execSync(`powershell -Command "${psCommand}"`, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
106
|
+
console.log(`[sshifu] Extraction completed, checking files...`);
|
|
107
|
+
const afterExtract = fs.readdirSync(binDir);
|
|
108
|
+
console.log(`[sshifu] Files after extraction: ${afterExtract.join(', ')}`);
|
|
100
109
|
} catch (extractErr) {
|
|
101
110
|
console.error(`[sshifu] Extraction failed: ${extractErr.message}`);
|
|
111
|
+
console.error(`[sshifu] stderr: ${extractErr.stderr?.toString() || 'N/A'}`);
|
|
112
|
+
console.error(`[sshifu] stdout: ${extractErr.stdout?.toString() || 'N/A'}`);
|
|
102
113
|
throw extractErr;
|
|
103
114
|
}
|
|
104
115
|
} else {
|