7 Commits

Author SHA1 Message Date
Godzil
8f7babd809 1.4.6 2019-03-04 18:51:27 +01:00
Godzil
c708df574b Update deps 2019-03-04 18:49:29 +01:00
Godzil
401a511668 Add Node 10 and 11 2019-03-04 18:44:41 +01:00
Godzil
969879921e 1.4.5 2018-10-04 20:08:15 +01:00
Godzil
546ba9b45a Add a warn when login failed to be more explicit 2018-10-04 20:07:54 +01:00
Godzil
27bdf54782 Solve issue with redirection (now it should follow automatically) 2018-10-04 20:02:28 +01:00
Godzil
beed932e93 Javascript: I hate you.
(fix a **** stupid bug while doing version checking)
2018-08-27 18:16:23 +01:00
5 changed files with 143 additions and 18 deletions

View File

@@ -3,6 +3,8 @@ sudo: false
node_js: node_js:
- 8 - 8
- 9 - 9
- 10
- 11
before_install: before_install:
- npm install --only=dev - npm install --only=dev
script: script:

145
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "crunchy", "name": "crunchy",
"version": "1.4.4", "version": "1.4.6",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -56,9 +56,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "10.5.3", "version": "11.10.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.3.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-11.10.4.tgz",
"integrity": "sha512-jQ1p+SyF/z8ygPxfSPKZKMWazlCgTBSyIaC1UCUvkLHDdxdmPQtQFk02X4WFM31Z1BKMAS3MSAK0cRP2c92n6Q==", "integrity": "sha512-wa09itaLE8L705aXd8F80jnFpxz3Y1/KRHfKsYL2bPc0XF+wEWu8sR9n5bmeu8Ba1N9z2GRNzm/YdHcghLkLKg==",
"dev": true "dev": true
}, },
"@types/request": { "@types/request": {
@@ -538,11 +538,112 @@
} }
}, },
"cloudscraper": { "cloudscraper": {
"version": "1.5.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/cloudscraper/-/cloudscraper-1.5.0.tgz", "resolved": "https://registry.npmjs.org/cloudscraper/-/cloudscraper-2.0.1.tgz",
"integrity": "sha512-bZagLhj59+N6Z6lD9zRksYu87GthLwXdKARULi4RZ6UVpotH39ruSFN3UQmw3uuqoj00iDxkGrapAvxeurmlQA==", "integrity": "sha512-6bKoZSjU2lnyNrDVRPti7sByyNOAyFgDzBUJR7a1+/5WNG8LogrOFLgNdkpuhRhbJp5qM/aKSDQUoJAcd2DPGw==",
"requires": { "requires": {
"request": "^2.49.0" "request": "^2.88.0"
},
"dependencies": {
"ajv": {
"version": "6.10.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"aws4": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
},
"har-validator": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
"requires": {
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
}
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"mime-db": {
"version": "1.38.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg=="
},
"mime-types": {
"version": "2.1.22",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
"requires": {
"mime-db": "~1.38.0"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"request": {
"version": "2.88.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.0",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"tough-cookie": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
"requires": {
"psl": "^1.1.24",
"punycode": "^1.4.1"
}
}
} }
}, },
"co": { "co": {
@@ -1958,7 +2059,7 @@
}, },
"onetime": { "onetime": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
"dev": true "dev": true
}, },
@@ -2195,6 +2296,11 @@
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
"dev": true "dev": true
}, },
"psl": {
"version": "1.1.31",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
"integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw=="
},
"punycode": { "punycode": {
"version": "1.4.1", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
@@ -2794,9 +2900,9 @@
"optional": true "optional": true
}, },
"typescript": { "typescript": {
"version": "2.9.2", "version": "3.3.3333",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz",
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==",
"dev": true "dev": true
}, },
"underscore.string": { "underscore.string": {
@@ -2847,6 +2953,21 @@
"xdg-basedir": "^3.0.0" "xdg-basedir": "^3.0.0"
} }
}, },
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"requires": {
"punycode": "^2.1.0"
},
"dependencies": {
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
}
}
},
"url-parse-lax": { "url-parse-lax": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",

View File

@@ -15,7 +15,7 @@
"engines": { "engines": {
"node": ">=5.0" "node": ">=5.0"
}, },
"version": "1.4.4", "version": "1.4.6",
"bin": { "bin": {
"crunchy": "./bin/crunchy", "crunchy": "./bin/crunchy",
"crunchy.sh": "./bin/crunchy.sh" "crunchy.sh": "./bin/crunchy.sh"
@@ -24,7 +24,7 @@
"big-integer": "^1.6.32", "big-integer": "^1.6.32",
"bluebird": "^3.5.1", "bluebird": "^3.5.1",
"cheerio": "^0.22.0", "cheerio": "^0.22.0",
"cloudscraper": "^1.5.0", "cloudscraper": "^2.0.1",
"commander": "^2.16.0", "commander": "^2.16.0",
"fs-extra": "^7.0.0", "fs-extra": "^7.0.0",
"mkdirp": "^0.5.0", "mkdirp": "^0.5.0",
@@ -40,7 +40,7 @@
"@types/cheerio": "^0.22.8", "@types/cheerio": "^0.22.8",
"@types/fs-extra": "^5.0.4", "@types/fs-extra": "^5.0.4",
"@types/mkdirp": "^0.5.2", "@types/mkdirp": "^0.5.2",
"@types/node": "^10.5.3", "@types/node": "^11.10.4",
"@types/request": "^2.47.1", "@types/request": "^2.47.1",
"@types/request-promise": "^4.1.42", "@types/request-promise": "^4.1.42",
"@types/uuid": "^3.4.3", "@types/uuid": "^3.4.3",
@@ -48,7 +48,7 @@
"npm-check": "^5.7.1", "npm-check": "^5.7.1",
"tsconfig-lint": "^0.12.0", "tsconfig-lint": "^0.12.0",
"tslint": "^5.11.0", "tslint": "^5.11.0",
"typescript": "^2.9.2" "typescript": "^3.3.3333"
}, },
"scripts": { "scripts": {
"prepublishOnly": "npm run build", "prepublishOnly": "npm run build",

View File

@@ -11,7 +11,7 @@ log.info('Crunchy version ' + current_version);
request.get({ uri: 'https://box.godzil.net/getVersion.php?tool=crunchy&v=' + current_version }, request.get({ uri: 'https://box.godzil.net/getVersion.php?tool=crunchy&v=' + current_version },
(error: Error, response: any, body: any) => (error: Error, response: any, body: any) =>
{ {
if (response && (response.StatusCode === 200)) if (response && (response.statusCode === 200))
{ {
const onlinepkg = JSON.parse(body); const onlinepkg = JSON.parse(body);
if (onlinepkg.status === 'ok') if (onlinepkg.status === 'ok')
@@ -28,7 +28,7 @@ request.get({ uri: 'https://box.godzil.net/getVersion.php?tool=crunchy&v=' + cur
} }
else else
{ {
log.info('Cannot check version.'); log.info('Error while checking for the current version.');
} }
}); });

View File

@@ -148,6 +148,7 @@ function checkIfUserIsAuth(config: IConfig, done: (err: Error) => void): void
if (isAuthenticated === false) if (isAuthenticated === false)
{ {
const error = $('ul.message, li.error').text(); const error = $('ul.message, li.error').text();
log.warn('Authentication failed: ' + error);
return done(AuthError('Authentication failed: ' + error)); return done(AuthError('Authentication failed: ' + error));
} }
else else
@@ -420,6 +421,7 @@ function modify(options: string|request.Options, reqMethod: string): request.Opt
options.jar = j; options.jar = j;
options.headers = defaultHeaders; options.headers = defaultHeaders;
options.method = reqMethod; options.method = reqMethod;
options.followAllRedirects = true;
return options; return options;
} }
return { return {