vaderjs 2.0.9 → 2.1.1
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/main.js +2 -31
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -4,8 +4,7 @@ import ansiColors from 'ansi-colors'
|
|
|
4
4
|
import { Glob } from 'bun'
|
|
5
5
|
const args = Bun.argv.slice(2)
|
|
6
6
|
globalThis.isBuilding = false;
|
|
7
|
-
import fs from 'fs'
|
|
8
|
-
import { spawn } from 'child_process'
|
|
7
|
+
import fs from 'fs'
|
|
9
8
|
import { platform } from 'os'
|
|
10
9
|
import path from 'path'
|
|
11
10
|
|
|
@@ -15,35 +14,7 @@ if (platform() === 'win32') {
|
|
|
15
14
|
} else {
|
|
16
15
|
bunPath = path.resolve(process.env.HOME || process.env.USERPROFILE, '.bun', 'bin', 'bun');
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
// dont log spawn output
|
|
21
|
-
const install = spawn('bash', [ 'curl -fsSL https://bun.sh/install | bash && export PATH=$HOME/.bun/bin:$PATH'], {
|
|
22
|
-
stdio: 'ignore',
|
|
23
|
-
shell: true, // Allows running shell commands
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
install.on('close', (code) => {
|
|
27
|
-
if (code === 0) {
|
|
28
|
-
console.log('Bun installed successfully.');
|
|
29
|
-
resolve(true);
|
|
30
|
-
} else {
|
|
31
|
-
console.error('Failed to install Bun.');
|
|
32
|
-
reject(new Error('Bun installation failed.'));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
install.on('error', (err) => {
|
|
37
|
-
console.error('Error during Bun installation:', err);
|
|
38
|
-
reject(err);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if(!fs.existsSync(bunPath)){
|
|
44
|
-
console.log('Bun is not installed, installing now...')
|
|
45
|
-
await checkIfBunInstalled()
|
|
46
|
-
}
|
|
17
|
+
|
|
47
18
|
|
|
48
19
|
|
|
49
20
|
|