env-cmd/lib/utils.js
Todd Bluhm 0738042dbb Initial conversion of lib over to typescript
- All env-cmd-examples repo cases passing
- Added support for default .env-cmdrc.json file
- Added flag and help text lib
- Split up project into more reasonable files/chunks of code
- Updated copyright year to 2019
2019-01-31 16:12:55 -05:00

24 lines
683 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var os = require("os");
/**
* A simple function for resolving the path the user entered
*/
function resolveEnvFilePath(userPath) {
// Make sure a home directory exist
var home = os.homedir();
if (home) {
userPath = userPath.replace(/^~($|\/|\\)/, home + "$1");
}
return path.resolve(process.cwd(), userPath);
}
exports.resolveEnvFilePath = resolveEnvFilePath;
/**
* A simple function that parses a comma separated string into an array of strings
*/
function parseArgList(list) {
return list.split(',');
}
exports.parseArgList = parseArgList;