Skip to content

Commit 48d74a1

Browse files
0.0.0
1 parent f7509c8 commit 48d74a1

File tree

5 files changed

+217
-60
lines changed

5 files changed

+217
-60
lines changed

package-lock.json

Lines changed: 157 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
"name": "i-pv",
33
"version": "0.0.0",
44
"org_ipv": {
5-
"version": "1.46"
5+
"version": "1.46"
66
},
77
"description": "Interactive Protein Sequence VIsualization/Viewer - Interactive Circos",
88
"main": "./i-pv/script/SNPtoAA.pl",
99
"access": "public",
1010
"scripts": {
11-
"replaceMasterBranch": "cross-env-shell BRANCH_NAME=v1.46 node ./util/replaceMasterBranch.js",
11+
"replaceMasterBranch": "cross-env-shell BRANCH_NAME=v1.46 node ./util/replaceMasterBranch.js",
1212
"bumpPatchNPM": "cross-env-shell npm version patch -no-git-tag-version --force",
1313
"bumpMinorNPM": "cross-env-shell npm version minor -no-git-tag-version --force",
1414
"bumpMajorNPM": "cross-env-shell npm version major -no-git-tag-version --force",
15-
"bumpPatchIPV": "cross-env-shell BUMPTYPE=patch node ./util/bumpVersion.js",
15+
"bumpPatchIPV": "cross-env-shell BUMPTYPE=patch node ./util/bumpVersion.js",
1616
"bumpMinorIPV": "cross-env-shell BUMPTYPE=minor node ./util/bumpVersion.js",
1717
"bumpMajorIPV": "cross-env-shell BUMPTYPE=major node ./util/bumpVersion.js",
18-
"bumpPatch": "npm run bumpPatchIPV && npm run bumpPatchNPM",
18+
"bumpPatch": "npm run bumpPatchIPV && npm run bumpPatchNPM",
1919
"bumpMinor": "npm run bumpMinorIPV && npm run bumpMinorNPM",
2020
"bumpMajor": "npm run bumpMajorIPV && npm run bumpMajorNPM",
2121
"gitCommit": "cross-env-shell git commit -m ${npm_package_version}",
@@ -27,7 +27,8 @@
2727
"publishRest": "npm run setGit && npm publish",
2828
"publishPatch": "npm run bumpPatch && npm run publishRest",
2929
"publishMinor": "npm run bumpMinor && npm run publishRest",
30-
"publishMajor": "npm run bumpMajor && npm run publishRest"
30+
"publishMajor": "npm run bumpMajor && npm run publishRest",
31+
"syncMirror": "cross-env-shell node ./util/syncMirror.js"
3132
},
3233
"keywords": [
3334
"interactive",
@@ -39,12 +40,11 @@
3940
"genetics",
4041
"proteomics",
4142
"genomics",
42-
"omics"
43+
"omics"
4344
],
4445
"author": "Ibrahim Tanyalcin",
4546
"license": "MIT",
4647
"devDependencies": {
47-
},
48-
"dependencies": {
48+
"cross-env": "^7.0.3"
4949
}
50-
}
50+
}

package.json.bck

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

util/bumpVersion.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

22
!function(){
3+
//process.env.PWD
4+
//process.cwd()
35
var pckjson = require('../package.json'),
46
NPM_VERSION = process.env.npm_package_version,
57
BUMPTYPE = process.env.BUMPTYPE,
68
ipvVersion = pckjson.org_ipv.version,
79
fs = require('fs'),
810
path = require('path'),
9-
file = path.join("../", "package.json");
11+
file = path.resolve(__dirname,'../','package.json');
1012
if(BUMPTYPE.toLowerCase() === "major"){
1113
pckjson.org_ipv.version = ipvVersion.toString()
1214
.replace(/^\s*[0-9]+(?=\.)/gi,function(m,o,s){

util/syncMirror.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
!function(){
3+
/*before running this
4+
- create a new repo at another site
5+
- get the new repo's remote addr: https://new-mirror-repo
6+
- git clone --mirror https://repo-to-mirror.git
7+
- cd to the cloned folder
8+
- git remote set-url --push origin https://new-mirror-repo
9+
*/
10+
var {exec} = require('child_process'),
11+
NPM_VERSION = process.env.npm_package_version,
12+
execute = function (str){
13+
const retVal = new Promise((res, rej) => {
14+
exec(str, (err, stdout, stderr) => {
15+
console.log(str, "\n");
16+
if (err) {
17+
rej(`error: ${err.message}`);
18+
return;
19+
}
20+
if (stderr) {
21+
if(stderr.match(/^\s*warning/i)){ //suppress these ->: warning: LF will be replaced by CRLF in package.json
22+
console.log("encountered a warning:", "\n", stderr, "\n");
23+
res(0);
24+
return;
25+
} else if (stderr.match("To https:\/\/")) { //changes pushed to repo, don't know why it goes to stderr
26+
console.log('pushed to repo successfully\n');
27+
res(0);
28+
return;
29+
}
30+
rej(`stderr: ${stderr}`);
31+
return;
32+
}
33+
if (err === null){
34+
res(0)
35+
return;
36+
}
37+
rej("unknown reason for rejection");
38+
return;
39+
});
40+
});
41+
return retVal;
42+
};
43+
execute('git fetch -p origin')
44+
.then(function(res){
45+
return execute('git push --mirror');
46+
})
47+
.catch(function(reason){console.log('Promise thrown or rejected. Reason:\n' + reason)});
48+
}();

0 commit comments

Comments
 (0)