Skip to content

Commit d72bf0f

Browse files
committed
renamed the post-pack script and added comments for clarity
1 parent 271a0b2 commit d72bf0f

3 files changed

Lines changed: 19 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Data-table plugin for Linkurious Enterprise",
55
"main": "index.js",
66
"scripts": {
7-
"postpack": "scripts/bundle.js"
7+
"postpack": "scripts/postpack.js"
88
},
99
"author": "Linkurious",
1010
"license": "Apache 2",

scripts/bundle.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

scripts/postpack.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
const { spawnSync } = require( 'child_process' );
5+
6+
// read the package.json file
7+
const pack = require(__dirname + '/../package.json');
8+
9+
// construct the archive base name
10+
const baseName = pack.name + '-' + pack.version;
11+
12+
// unzip the .TGZ file to a .TAR file
13+
const gunzip = spawnSync('gunzip', [baseName + '.tgz']);
14+
console.log('gunzip:' + gunzip.stdout.toString() + ' / ' + gunzip.stderr.toString());
15+
16+
// rename the .TAR file to an .LKE file
17+
const mv = spawnSync( 'mv', [baseName + '.tar', baseName + '.lke']);
18+
console.log('mv:' + mv.stdout.toString() + ' / ' + mv.stderr.toString());

0 commit comments

Comments
 (0)