transpic-cli 0.1.1 → 0.1.3
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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/bin/transpic-cli.exe +0 -0
- package/package.json +2 -2
- package/scripts/copy-binary.js +22 -0
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "transpic-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A fast image manipulation CLI tool",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"transpic": "./src/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "cargo build --release && node -
|
|
10
|
+
"build": "cargo build --release && node scripts/copy-binary.js"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"cli",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
5
|
+
const targetReleaseDir = path.join(__dirname, '..', 'target', 'release');
|
|
6
|
+
|
|
7
|
+
const binaryName = process.platform === 'win32' ? 'transpic-cli.exe' : 'transpic-cli';
|
|
8
|
+
|
|
9
|
+
const source = path.join(targetReleaseDir, binaryName);
|
|
10
|
+
const destination = path.join(binDir, binaryName);
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(binDir)) {
|
|
13
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
fs.copyFileSync(source, destination);
|
|
18
|
+
console.log(`✓ Binary successfully copied to: ${destination}`);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error(`Error copying binary: ${err.message}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|