Make lint happy (sorry cookie monster, nothing for you here :( )

This commit is contained in:
Godzil 2018-08-01 19:57:29 +01:00
parent 9c3aaf220a
commit 2e8de8c5c2
3 changed files with 13 additions and 8 deletions

View File

@ -35,7 +35,8 @@ export default function(args: string[], done: (err?: Error) => void)
config.pass = undefined;
my_request.eatCookies(config);
cfg.save(config);
log.info("Unlogged!");
log.info('Unlogged!');
process.exit(0);
}

View File

@ -3,7 +3,7 @@ import os = require('os');
import fs = require('fs-extra');
import path = require('path');
const configFile = path.join(process.cwd(), "config.json");
const configFile = path.join(process.cwd(), 'config.json');
function fileExist(path: string)
{

View File

@ -152,10 +152,12 @@ function checkIfUserIsAuth(config: IConfig, done: (err: Error) => void): void
function loadCookies(config: IConfig)
{
const cookiePath = path.join(config.output || process.cwd(), '.cookies.json');
if(!fs.existsSync(cookiePath))
if (!fs.existsSync(cookiePath))
{
fs.closeSync(fs.openSync(cookiePath, 'w'));
}
j = request.jar(new cookieStore(cookiePath));
}
@ -163,10 +165,11 @@ export function eatCookies(config: IConfig)
{
const cookiePath = path.join(config.output || process.cwd(), '.cookies.json');
if(fs.existsSync(cookiePath))
if (fs.existsSync(cookiePath))
{
fs.removeSync(cookiePath);
}
j = undefined;
}
@ -190,6 +193,7 @@ export function get(config: IConfig, options: string|request.Options, done: (err
cloudscraper.request(modify(options, 'GET'), (error: any, response: any, body: any) =>
{
if (error) return done(error);
done(null, typeof body === 'string' ? body : String(body));
});
});