|
54 | 54 | }
|
55 | 55 | process.exit(1);
|
56 | 56 | } finally {
|
57 |
| - if (fs.existsSync(tempDir)) { |
58 |
| - fs.rmSync(tempDir, { recursive: true, force: true}); |
59 |
| - } |
| 57 | + //if (fs.existsSync(tempDir)) { |
| 58 | + // fs.rmSync(tempDir, { recursive: true, force: true}); |
| 59 | + //} |
60 | 60 | }
|
61 | 61 |
|
62 | 62 | /**
|
|
66 | 66 | */
|
67 | 67 | function moveCompileTimeDeps() {
|
68 | 68 | console.log("Moving external compile time dependencies to correct directories");
|
| 69 | + if (!fs.existsSync(externalCompileTimeDepsPath)) { |
| 70 | + fs.mkdirSync(externalCompileTimeDepsPath, { recursive: true }); |
| 71 | + } |
69 | 72 | if (platform() === 'win32') {
|
70 | 73 | const deps = ['CANBridge.lib', 'wpiHal.lib', 'wpiutil.lib'];
|
71 | 74 | deps.forEach(dep => moveExternalCompileTimeDeps(path.join('win32-x64', dep)));
|
@@ -95,24 +98,31 @@ function moveCompileTimeDeps() {
|
95 | 98 | */
|
96 | 99 | function moveRuntimeDeps() {
|
97 | 100 | console.log("Moving artifacts to correct directories");
|
| 101 | + if (!fs.existsSync('prebuilds')) { |
| 102 | + fs.mkdirSync('prebuilds', { recursive: true }); |
| 103 | + } |
98 | 104 | if (platform() === 'win32') {
|
99 | 105 | const deps = ['CANBridge.dll', 'wpiHal.dll', 'wpiutil.dll'];
|
100 | 106 | deps.forEach(dep => moveRuntimeArtifactsDeps(path.join('win32-x64', dep), runtimeArtifactsPath.win));
|
101 | 107 | } else if (platform() === 'darwin') {
|
102 | 108 | const deps = ['libCANBridge.dylib', 'libwpiHal.dylib', 'libwpiutil.dylib'];
|
103 |
| - const archDepMap = { |
104 |
| - x64: runtimeArtifactsPath.osx, |
105 |
| - arm64: runtimeArtifactsPath.osxArm |
106 |
| - }; |
107 |
| - deps.forEach(dep => moveRuntimeArtifactsDeps(path.join(archDepMap[arch()], dep), archDepMap[arch()])); |
| 109 | + if (arch() === 'x64') { |
| 110 | + deps.forEach(dep => moveRuntimeArtifactsDeps(path.join('darwin-x64', dep), runtimeArtifactsPath.osx)); |
| 111 | + } |
| 112 | + if (arch() === 'arm64') { |
| 113 | + deps.forEach(dep => moveRuntimeArtifactsDeps(path.join('darwin-arm64', dep), runtimeArtifactsPath.osxArm)); |
| 114 | + } |
108 | 115 | } else if (platform() === 'linux') {
|
109 | 116 | const deps = ['libCANBridge.so', 'libwpiHal.so', 'libwpiutil.so'];
|
110 |
| - const archDepMap = { |
111 |
| - x64: runtimeArtifactsPath.linux, |
112 |
| - arm64: runtimeArtifactsPath.linuxArm, |
113 |
| - arm: runtimeArtifactsPath.linuxArm32 |
114 |
| - }; |
115 |
| - deps.forEach(dep => moveRuntimeArtifactsDeps(path.join(archDepMap[arch()], dep), archDepMap[arch()])); |
| 117 | + if (arch() === 'x64') { |
| 118 | + deps.forEach(dep => moveRuntimeArtifactsDeps(path.join('linux-x64', dep), runtimeArtifactsPath.linux)); |
| 119 | + } |
| 120 | + if (arch() === 'arm64') { |
| 121 | + deps.forEach(dep => moveRuntimeArtifactsDeps(path.join('linux-arm64', dep), runtimeArtifactsPath.linuxArm)); |
| 122 | + } |
| 123 | + if (arch() === 'arm') { |
| 124 | + deps.forEach(dep => moveRuntimeArtifactsDeps(path.join('linux-arm32', dep), runtimeArtifactsPath.linuxArm32)); |
| 125 | + } |
116 | 126 | }
|
117 | 127 | console.log("CANBridge artifacts moved to correct directories");
|
118 | 128 | }
|
|
0 commit comments