create basic structure

This commit is contained in:
Philipp Kunz 2016-06-19 20:08:34 +02:00
parent 27b583cf87
commit 8b715c52ac
4 changed files with 35 additions and 1 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# qenv
provides an easy way for promised environments
## Usage
qenv looks for an qenv.yml that defines needed env vars. qenv dirst checks if they are already specified.
If not, qenv by default looks for a .nogit/env.yml file.
If any env var is not specified, qenv throws an error and exits.

View File

@ -1,7 +1,7 @@
{ {
"name": "qenv", "name": "qenv",
"version": "1.0.1", "version": "1.0.1",
"description": "smart handling of environment variables", "description": "promised environments",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"test": "(npmts)" "test": "(npmts)"

View File

@ -0,0 +1,26 @@
import * as plugins from "./qenv.plugins";
export class qenv {
envVarsRequired:string[];
envVarsAvailable:string[];
envVarsMissing:string[];
constructor(basePathArg = "./qenv.yml",envYmlPathArg){
this.envVarsRequired = getEnvVarsRequired(basePathArg);
this.envVarsAvailable;
}
};
let getEnvVarsRequired = (pathArg:string):string[] => {
let result:string[] = [];
let qenvFilePath = plugins.path.join(pathArg,"qenv.yml");
let qenvFile = plugins.smartfile.local.toObjectSync(qenvFilePath);
for(let keyArg in qenvFile.vars){
result.push(qenvFile.vars[keyArg]);
}
return result;
}
let getEnvVarsAvailable = ():string[] => {
let result = [];
return result;
}

View File

@ -1,3 +1,4 @@
import "typings-global"; import "typings-global";
export import beautylog = require("beautylog"); export import beautylog = require("beautylog");
export import path = require("path");
export import smartfile = require("smartfile"); export import smartfile = require("smartfile");