-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(credstash): Add credstash support (#14)
* feat(credstash): Add credstash support * feat(credstash): Add credstash support * feat(credstash): Fix error validation formatting * feat(credstash): Add credstash support * feat(credstash): Fix .vscode
- Loading branch information
Ben Ross
authored
Apr 20, 2018
1 parent
fc9f369
commit d62bd69
Showing
9 changed files
with
147 additions
and
18 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Jest", | ||
"type": "node", | ||
"request": "launch", | ||
"program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js", | ||
"stopOnEntry": false, | ||
"args": [ | ||
"--runInBand", | ||
"${file}" | ||
], | ||
"cwd": "${workspaceRoot}", | ||
"protocol": "legacy", | ||
"runtimeArgs": [ | ||
"--nolazy" | ||
], | ||
"sourceMaps": true, | ||
"outFiles": [ | ||
"${workspaceRoot}/dist/**/*.js" | ||
] | ||
}, | ||
{ | ||
"name": "TS-Node", | ||
"type": "node", | ||
"request": "launch", | ||
"args": [ | ||
"${relativeFile}" | ||
], | ||
"runtimeArgs": [ | ||
"--nolazy", | ||
"-r", | ||
"ts-node/register" | ||
], | ||
"sourceMaps": true, | ||
"cwd": "${workspaceRoot}", | ||
"protocol": "inspector", | ||
"runtimeVersion": "8.10.0" | ||
} | ||
] | ||
} |
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,18 @@ | ||
{ | ||
"prettier.printWidth": 100, | ||
"prettier.singleQuote": true, | ||
"typescript.tsdk": "./node_modules/typescript/lib", | ||
"search.exclude": { | ||
"dist/": true | ||
}, | ||
"[javascript]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"[json]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": true | ||
} | ||
} | ||
|
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,21 @@ | ||
import * as fs from 'fs'; | ||
|
||
export function writeFile(document: { [name: string]: string }) { | ||
let output = ''; | ||
const keys = Object.keys(document); | ||
for (const key of keys) { | ||
output += `${key}=${document[key]}\n`; | ||
} | ||
fs.writeFileSync('.env', output); | ||
} | ||
|
||
export function validateDocument(document: any): string[] { | ||
const errors = []; | ||
const keys = Object.keys(document); | ||
for (const key of keys) { | ||
if (typeof document[key] !== 'string') { | ||
errors.push(`${key} has an invalid value ${JSON.stringify(document[key])}`); | ||
} | ||
} | ||
return errors; | ||
} |
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