-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude-axios.js
More file actions
25 lines (20 loc) · 825 Bytes
/
include-axios.js
File metadata and controls
25 lines (20 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const zipfile = require('yauzl');
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const vsixFile = 'taskmanager-vscode-1.2.0.vsix';
const tempDir = 'temp_vsix_extract';
const extractDir = path.join(tempDir, 'extension');
// Распаковываем VSIX
execSync(`unzip -q ${vsixFile} -d ${tempDir}`);
// Копируем axios
if (fs.existsSync('node_modules/axios')) {
const destAxios = path.join(extractDir, 'node_modules', 'axios');
fs.mkdirSync(path.dirname(destAxios), { recursive: true });
execSync(`cp -r node_modules/axios ${destAxios}`);
console.log('Copied axios to package');
}
// Переупаковываем
execSync(`cd ${tempDir} && zip -r -q ../${vsixFile} .`);
execSync(`rm -rf ${tempDir}`);
console.log('VSIX repackaged with axios');