Skip to content

Commit

Permalink
update packer
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed Nov 26, 2022
1 parent dffc78e commit 99069e1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const GulpClient = require('gulp');
const { join, dirname } = require('upath');
const packagejson = require('./package.json');

console.log('='.repeat(19));
console.log('= packing started =');
console.log('='.repeat(19));

const releaseDir = join(__dirname, 'release');
const child = spawn('npm', ['pack'], { cwd: __dirname, stdio: 'ignore' });
let version = (function () {
Expand All @@ -21,6 +25,14 @@ let version = (function () {
child.on('exit', function () {
const filename = slugifyPkgName(`${packagejson.name}-${version}.tgz`);
const tgz = join(__dirname, filename);

if (!existsSync(tgz)) {
const filename2 = slugifyPkgName(
`${packagejson.name}-${packagejson.version}.tgz`
);
const origintgz = join(__dirname, filename2);
renameSync(origintgz, tgz);
}
const tgzlatest = join(releaseDir, slugifyPkgName(`${packagejson.name}.tgz`));

console.log({ tgz, tgzlatest });
Expand All @@ -38,7 +50,10 @@ child.on('exit', function () {
}
renameSync(tgz, tgzlatest);
addReadMe();
rmSync(tgz);
if (existsSync(tgz)) rmSync(tgz);
console.log('='.repeat(20));
console.log('= packing finished =');
console.log('='.repeat(20));
});
}
});
Expand Down
Binary file modified release/hexo-post-parser-1.1.19.tgz
Binary file not shown.
Binary file modified release/hexo-post-parser.tgz
Binary file not shown.

0 comments on commit 99069e1

Please # to comment.