4 Commits

Author SHA1 Message Date
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
4 changed files with 6 additions and 4 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "crunchy",
"version": "1.4.4",
"version": "1.4.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -15,7 +15,7 @@
"engines": {
"node": ">=5.0"
},
"version": "1.4.4",
"version": "1.4.5",
"bin": {
"crunchy": "./bin/crunchy",
"crunchy.sh": "./bin/crunchy.sh"

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 },
(error: Error, response: any, body: any) =>
{
if (response && (response.StatusCode === 200))
if (response && (response.statusCode === 200))
{
const onlinepkg = JSON.parse(body);
if (onlinepkg.status === 'ok')
@@ -28,7 +28,7 @@ request.get({ uri: 'https://box.godzil.net/getVersion.php?tool=crunchy&v=' + cur
}
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)
{
const error = $('ul.message, li.error').text();
log.warn('Authentication failed: ' + error);
return done(AuthError('Authentication failed: ' + error));
}
else
@@ -420,6 +421,7 @@ function modify(options: string|request.Options, reqMethod: string): request.Opt
options.jar = j;
options.headers = defaultHeaders;
options.method = reqMethod;
options.followAllRedirects = true;
return options;
}
return {