mirror of https://github.com/tycrek/ass
parent
d5bd01b814
commit
c4b43ddf68
@ -1,14 +0,0 @@
|
||||
{
|
||||
"HTTP": 80,
|
||||
"HTTPS": 443,
|
||||
"CODE_OK": 200,
|
||||
"CODE_NO_CONTENT": 204,
|
||||
"CODE_BAD_REQUEST": 400,
|
||||
"CODE_UNAUTHORIZED": 401,
|
||||
"CODE_NOT_FOUND": 404,
|
||||
"CODE_CONFLICT": 409,
|
||||
"CODE_PAYLOAD_TOO_LARGE": 413,
|
||||
"CODE_UNSUPPORTED_MEDIA_TYPE": 415,
|
||||
"CODE_INTERNAL_SERVER_ERROR": 500,
|
||||
"KILOBYTES": 1024
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
const check = require("check-node-version");
|
||||
const ENGINES = require('../package.json').engines;
|
||||
|
||||
const { TLog } = require('@tycrek/log');
|
||||
const logger = new TLog();
|
||||
|
||||
function doCheck() {
|
||||
return new Promise((resolve, reject) =>
|
||||
check(ENGINES, (err, { isSatisfied: allSatisfied, versions }) =>
|
||||
err ? reject(err) : allSatisfied ? resolve('Node & npm version requirements satisfied!')
|
||||
: reject(Object.entries(versions)
|
||||
.filter(([, { isSatisfied }]) => (!isSatisfied))
|
||||
.map(([packageName, { version: current, wanted: minimum }]) =>
|
||||
`\nInvalid ${packageName} version!\n- Current: ${current}\n- Required: ${minimum}`)
|
||||
.join('')
|
||||
.concat('\nPlease update to continue!'))));
|
||||
}
|
||||
|
||||
if (require.main !== module) module.exports = doCheck;
|
||||
else doCheck()
|
||||
.then((result) => logger.comment(`Wanted: ${ENGINES.node} (npm ${ENGINES.npm})`)/* .node() */.success(result))
|
||||
.catch((err) => logger.error(err) && process.exit(1));
|
@ -1,10 +0,0 @@
|
||||
import { TLog } from '@tycrek/log';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
// Set up logging
|
||||
const logger = new TLog(process.env.NODE_ENV === 'production' ? 'info' : 'debug')
|
||||
.setTimestamp({ preset: DateTime.DATETIME_MED });
|
||||
|
||||
// todo: re-enable the Express logger
|
||||
|
||||
export default logger;
|
@ -1,16 +0,0 @@
|
||||
import { TLog } from '@tycrek/log';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
|
||||
const log = new TLog();
|
||||
const uploadsPath = path.join(process.cwd(), 'uploads/');
|
||||
const dataPath = path.join(process.cwd(), 'data.json');
|
||||
|
||||
if (fs.existsSync(uploadsPath)) {
|
||||
fs.removeSync(uploadsPath);
|
||||
log.success('Deleted', uploadsPath);
|
||||
}
|
||||
if (fs.existsSync(dataPath)) {
|
||||
fs.removeSync(dataPath);
|
||||
log.success('Deleted', dataPath);
|
||||
}
|
Loading…
Reference in new issue