From b33dd78bd17852ed67e54db82742b447ec494e54 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Thu, 20 Feb 2020 10:47:38 +0100 Subject: [PATCH] formatting --- jenkins.js | 3 +-- snippets/jenkins/index.js | 6 ++++-- snippets/jenkins/template/node/jenkins.js | 5 ++--- snippets/migration/index.js | 3 ++- snippets/node/index.js | 6 ++++-- snippets/requestor/index.js | 3 ++- snippets/snippet/index.js | 6 ++++-- snippets/snippet/template/index.js | 6 ++++-- 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/jenkins.js b/jenkins.js index 7080af9..fb5239d 100644 --- a/jenkins.js +++ b/jenkins.js @@ -22,6 +22,5 @@ child_process.exec ('git log -1 | grep \'\\[no publish\\]\'') console.log ('build not marked for deployment'); process.exit (1); } - else - child_process.execSync ('yarn publish'); + else { child_process.execSync ('yarn publish'); } }); diff --git a/snippets/jenkins/index.js b/snippets/jenkins/index.js index 1b39d61..7c28e69 100644 --- a/snippets/jenkins/index.js +++ b/snippets/jenkins/index.js @@ -26,12 +26,13 @@ function run (folder, args) { : 'general' ); - for (const f of fs.readdirSync (template)) + for (const f of fs.readdirSync (template)) { fs.copy ( path.join (template, f), path.join (folder, f), { filter: (src, dest) => !fs.existsSync (dest) } ); + } } /** @@ -51,11 +52,12 @@ function assert (folder) { reason: 'cwd does not exist (internal error)' } ]; - for (const test of tests) + for (const test of tests) { if (!test.f ()) { console.log (test.reason); return false; } + } return true; } diff --git a/snippets/jenkins/template/node/jenkins.js b/snippets/jenkins/template/node/jenkins.js index 099b983..fb5239d 100644 --- a/snippets/jenkins/template/node/jenkins.js +++ b/snippets/jenkins/template/node/jenkins.js @@ -13,7 +13,7 @@ const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8')); fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2)); child_process.execSync ('yarn lint', { stdio: 'inherit' }); -if (typeof pkg.scripts !=='undefined' && typeof pkg.scripts.test === 'string') +if (typeof pkg.scripts !== 'undefined' && typeof pkg.scripts.test === 'string') child_process.execSync ('yarn test', { stdio: 'inherit' }); child_process.exec ('git log -1 | grep \'\\[no publish\\]\'') @@ -22,6 +22,5 @@ child_process.exec ('git log -1 | grep \'\\[no publish\\]\'') console.log ('build not marked for deployment'); process.exit (1); } - else - child_process.execSync ('yarn publish'); + else { child_process.execSync ('yarn publish'); } }); diff --git a/snippets/migration/index.js b/snippets/migration/index.js index a37e715..14545ff 100644 --- a/snippets/migration/index.js +++ b/snippets/migration/index.js @@ -57,11 +57,12 @@ function assert (folder, args) { reason: 'migration already exists' } ]; - for (const test of tests) + for (const test of tests) { if (!test.f ()) { console.log (test.reason); return false; } + } return true; } diff --git a/snippets/node/index.js b/snippets/node/index.js index 64a793a..30ecbbf 100644 --- a/snippets/node/index.js +++ b/snippets/node/index.js @@ -26,7 +26,7 @@ async function run (folder, args) { const template = path.join (__dirname, 'template'); if (!fs.existsSync (snip_folder)) fs.mkdir (snip_folder); - for (const f of fs.readdirSync (template)) + for (const f of fs.readdirSync (template)) { fs.copy ( path.join (template, f), path.join (snip_folder, f), @@ -35,6 +35,7 @@ async function run (folder, args) { filter: (src, dest) => !fs.existsSync (dest) } ); + } child_process.execSync ( 'git init', @@ -106,11 +107,12 @@ function assert (folder, args) { reason: 'folder already exists' } ]; - for (const test of tests) + for (const test of tests) { if (!test.f ()) { console.log (test.reason); return false; } + } return true; } diff --git a/snippets/requestor/index.js b/snippets/requestor/index.js index cff15c4..da67176 100644 --- a/snippets/requestor/index.js +++ b/snippets/requestor/index.js @@ -57,11 +57,12 @@ function assert (folder, args) { reason: 'file already exists' } ]; - for (const test of tests) + for (const test of tests) { if (!test.f ()) { console.log (test.reason); return false; } + } return true; } diff --git a/snippets/snippet/index.js b/snippets/snippet/index.js index 9d53fb3..da2903c 100644 --- a/snippets/snippet/index.js +++ b/snippets/snippet/index.js @@ -25,7 +25,7 @@ function run (folder, args) { const template = path.join (__dirname, 'template'); if (!fs.existsSync (snip_folder)) fs.mkdir (snip_folder); - for (const f of fs.readdirSync (template)) + for (const f of fs.readdirSync (template)) { fs.copy ( path.join (template, f), path.join (snip_folder, f), @@ -34,6 +34,7 @@ function run (folder, args) { filter: (src, dest) => !fs.existsSync (dest) } ); + } } /** @@ -75,11 +76,12 @@ function assert (folder, args) { reason: 'folder already exists' } ]; - for (const test of tests) + for (const test of tests) { if (!test.f ()) { console.log (test.reason); return false; } + } return true; } diff --git a/snippets/snippet/template/index.js b/snippets/snippet/template/index.js index 9d53fb3..da2903c 100644 --- a/snippets/snippet/template/index.js +++ b/snippets/snippet/template/index.js @@ -25,7 +25,7 @@ function run (folder, args) { const template = path.join (__dirname, 'template'); if (!fs.existsSync (snip_folder)) fs.mkdir (snip_folder); - for (const f of fs.readdirSync (template)) + for (const f of fs.readdirSync (template)) { fs.copy ( path.join (template, f), path.join (snip_folder, f), @@ -34,6 +34,7 @@ function run (folder, args) { filter: (src, dest) => !fs.existsSync (dest) } ); + } } /** @@ -75,11 +76,12 @@ function assert (folder, args) { reason: 'folder already exists' } ]; - for (const test of tests) + for (const test of tests) { if (!test.f ()) { console.log (test.reason); return false; } + } return true; }