This repository has been archived by the owner on May 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
scriptPilot
authored and
scriptPilot
committed
Oct 30, 2017
1 parent
7100453
commit 2fa0966
Showing
6 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Purpose: Update .editorconfig file according app/config.json | ||
|
||
// Import modules | ||
const env = require('./env') | ||
const fs = require('fs-extra') | ||
const path = require('path') | ||
|
||
// Check availability of the config | ||
if (!env.cfg.editorConfig) throw new Error('Missing editorConfig item in config.json file.') | ||
|
||
// Create file content | ||
let content = '' | ||
|
||
// Loop config options | ||
for (let item in env.cfg.editorConfig) { | ||
content = content + item + (env.cfg.editorConfig[item] ? ' = ' + env.cfg.editorConfig[item] : '') + '\n' | ||
} | ||
|
||
// Create/update .editorconfig file | ||
fs.writeFile(path.resolve(env.app, '.editorconfig'), content, (err) => { | ||
if (err) throw err | ||
console.log('.editorconfig file updated.') | ||
}) |