Remove non-used script and add tools folder to npmignore

This commit is contained in:
Asi Bross 2017-06-26 14:32:52 -07:00 коммит произвёл Asi Bross
Родитель 2649af099a
Коммит f3ebdca4bc
3 изменённых файлов: 20 добавлений и 58 удалений

Просмотреть файл

@ -1,5 +1,6 @@
bin
build
tools
.npmrc
.npmignore

Просмотреть файл

@ -1,21 +1,21 @@
{
"name": "napajs",
"version": "0.4.1",
"author": "napajs",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"dependencies": {
"cmake-js": ">= 3.5.0",
"boost-lib": ">= 0.11.3"
},
"devDependencies": {
"typescript": ">= 2.2.1",
"@types/node": ">= 7.0.8",
"@types/mocha": ">= 2.2.0"
},
"scripts": {
"install": "cmake-js compile",
"postinstall": "cmake-js clean",
"prepublish": "node node_modules/typescript/lib/tsc.js -p lib"
}
"name": "napajs",
"version": "0.4.4",
"author": "napajs",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"dependencies": {
"cmake-js": ">= 3.5.0",
"boost-lib": ">= 0.11.3"
},
"devDependencies": {
"typescript": ">= 2.2.1",
"@types/node": ">= 7.0.8",
"@types/mocha": ">= 2.2.0"
},
"scripts": {
"install": "cmake-js compile",
"postinstall": "cmake-js clean",
"prepublish": "node node_modules/typescript/lib/tsc.js -p lib"
}
}

Просмотреть файл

@ -1,39 +0,0 @@
// This script is used for updating patch numbers in package.json files.
// It uses the current date to create an 8 digit patch number.
var fs = require('fs');
var packageObj = JSON.parse(fs.readFileSync('package.json'));
if (packageObj.version === undefined) {
console.error("package.json must have a version property");
process.exit(1);
}
// Create new package version
var packageVersion = packageObj.version.trim();
packageVersion = packageVersion.substring(0, packageVersion.lastIndexOf('.') + 1);
packageVersion += getPatchNumber();
// Update the package version
packageObj.version = packageVersion;
fs.writeFileSync('package.json', JSON.stringify(packageObj, null, 4));
function getPatchNumber() {
var date = new Date();
// Get the current year.
var year = date.getUTCFullYear().toString();
// getMonth returns [0,11] so adjust number for normal display.
var month = (date.getUTCMonth() + 1).toString();
if (month.length == 1) {
month = "0" + month;
}
// 2 digits that represent the current day in the month.
var day = date.getUTCDate().toString();
return year + month + day;
}