Compare commits

..

No commits in common. "f8416f8b9615a7dea8ded4b9065324c4be66957e" and "011873728965ef1e8aaed9a7448402888d7cf41f" have entirely different histories.

19 changed files with 26 additions and 101 deletions

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
module.exports = { module.exports = {
env: { env: {
commonjs: true, commonjs: true,

View File

@ -2,9 +2,9 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-console */ /* eslint-disable no-console */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
/* eslint-disable no-process-exit */ /* eslint-disable no-process-exit */
/* eslint-disable no-console */ /* eslint-disable no-console */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,12 +1,10 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, March 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */
/* eslint-disable no-console */ /* eslint-disable no-console */
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
@ -28,15 +26,14 @@ async function map_all_files (folder, func) {
if ([ 'node_modules' ].includes (file)) if ([ 'node_modules' ].includes (file))
continue; continue;
const abs_path = path.join (folder, file); const abs_path = path.join (folder, file);
if ((await fs.stat (abs_path)).isDirectory ()) { if ((await fs.stat (abs_path)).isDirectory ())
map_all_files (abs_path, func); map_all_files (abs_path, func);
continue;
} const data = await fs.readFile (abs_path);
const data = await fs.readFile (abs_path, 'utf-8'); const res = func (data);
const res = func (data, file);
if (res === null) if (res === null)
continue; continue;
await fs.writeFile (abs_path, res, 'utf-8'); await fs.writeFile (abs_path, res);
} }
} }
@ -83,13 +80,11 @@ function get_copyright_notice (license = '', software = '') {
* @param {string} software software name * @param {string} software software name
*/ */
async function fix_all_copy (folder, license = '', software = '') { async function fix_all_copy (folder, license = '', software = '') {
const regex = /\/\*\s+\*\sCopyright[\s\S]*?\*\/\n{0,2}/gu; const regex = /\/\*\s+\*\sCopyright[\s\S]*?\*\//gu;
await map_all_files (folder, (data, filename) => { await map_all_files (folder, (data) => {
const shebang = /^#!.*?\n\n/gu; if (!regex.test (data))
const shebang_line = shebang.exec(data);
if (!/\.js$/.test(filename) && !regex.test (data))
return null; return null;
return (shebang_line ? shebang_line[0] : '') + get_copyright_notice (license, software) + data.replace (regex, '').replace(shebang, ''); return get_copyright_notice (license, software) + data.replace (regex, '');
}); });
} }

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
/* eslint-disable no-magic-numbers */ /* eslint-disable no-magic-numbers */
/* eslint-disable no-console */ /* eslint-disable no-console */

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, February 2020
*/ */
/* eslint-disable no-magic-numbers */ /* eslint-disable no-magic-numbers */

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
/* eslint-disable no-process-exit */ /* eslint-disable no-process-exit */
/* eslint-disable no-console */ /* eslint-disable no-console */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
'use strict'; 'use strict';
const csv = require ('csv-parse'); const csv = require ('csv-parse');

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
/* eslint-disable no-magic-numbers */ /* eslint-disable no-magic-numbers */
'use strict'; 'use strict';

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
module.exports = { module.exports = {
env: { env: {
commonjs: true, commonjs: true,

View File

@ -1,7 +0,0 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
'use strict'; 'use strict';
module.exports = function handler (req, res, next, opts) { module.exports = function handler (req, res, next, opts) {

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,8 +1,8 @@
/* /*
* Copyright (C) Sapphirecode - All Rights Reserved * Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause. * This file is part of snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details. * See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020 * Created by Timo Hocker <timo@scode.ovh>, January 2020
*/ */
/* eslint-disable no-sync */ /* eslint-disable no-sync */

View File

@ -1,10 +1,3 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
'use strict'; 'use strict';
/** /**