Comparing version 1.0.0 to 1.0.1
@@ -34,4 +34,6 @@ #! /usr/bin/env node | ||
BR + "mkhere: Create files based on predefined emplates".inverse + BR + BR + | ||
"mkhere list ".green.bold + BR + "\t List all templates in " + tplDir.italic + BR + | ||
"mkhere tplname.html newname ".green.bold + BR + "\t Will create new file " + "newname.html".italic + " based on " + path.join(tplDir,"tplname.html").italic + " in current directory" | ||
"mkhere list ".green.bold + BR + | ||
"\t List all templates in " + tplDir.italic + BR + | ||
"mkhere tplname.html newname ".green.bold + BR + | ||
"\t Will create new file " + "newname.html".italic + " based on " + path.join(tplDir, "tplname.html").italic + " in current directory" | ||
); | ||
@@ -42,20 +44,14 @@ } | ||
var CWD = process.cwd(); | ||
var tplName = path.join(tplDir,process.argv[2]); | ||
var tplName = path.join(tplDir, process.argv[2]); | ||
var newFileExt = tplName.slice(tplName.indexOf('.')); | ||
var newFile = process.argv[3] + newFileExt; | ||
fs.readFile(tplName, 'utf8', function (err,data) { | ||
fs.readFile(tplName, 'utf8', function (err, data) { | ||
if (err) { | ||
return console.log( | ||
'Error! No such template file '.red + tplName.red.bold + ' in '.red + tplDir.red + BR + | ||
"For usage see: " + "mkhere help".bold | ||
"For usage see: " + "mkhere help".bold | ||
); | ||
} | ||
fs.writeFile(newFile,data); | ||
fs.writeFile(newFile, data); | ||
}); | ||
} | ||
console.log('USER HOME', getUserHome()); | ||
console.log('TPL', tplName); | ||
console.log('NEW FILE', newFile); | ||
console.log('CWD', CWD); | ||
console.log('LIST TPL FILES', list(path.join(getUserHome(), tplDir))); | ||
} |
{ | ||
"name": "mkhere", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Make files based on template", | ||
@@ -33,4 +33,11 @@ "main": "lib/mkhere.js", | ||
"bin": { | ||
"mkhere" : "lib/mkhere.js" | ||
"mkhere": "lib/mkhere.js" | ||
}, | ||
"dependencies": { | ||
"colors": "^0.6.2", | ||
"path": "^0.4.9" | ||
}, | ||
"engines": { | ||
"node": "*" | ||
} | ||
} |
@@ -5,5 +5,7 @@ # mkhere | ||
[![NPM](https://nodei.co/npm/mkhere.png)](https://nodei.co/npm/mkhere/) | ||
### Usage | ||
`mkhere list` - List all templates in /home/sasha/Templates | ||
`mkhere list` - List all templates in _\<USER_HOME_DIR\>/Templates/_ | ||
@@ -10,0 +12,0 @@ `mkhere help` - Show usage/help |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23933
18
2
46
+ Addedcolors@^0.6.2
+ Addedpath@^0.4.9
+ Addedcolors@0.6.2(transitive)
+ Addedpath@0.4.10(transitive)