gt-starter-npmrc
Advanced tools
Comparing version 1.0.5 to 1.0.6
14
bin.js
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
const {ArgumentParser} = pkg; | ||
import {existsSync, readFileSync, writeFileSync} from 'fs'; | ||
import {existsSync, readFileSync, writeFileSync, appendFileSync} from 'fs'; | ||
@@ -33,3 +33,13 @@ const parser = new ArgumentParser({ | ||
const npmFilePath = args.global ? `${HOME_DIR}/.npmrc` : `./npmrc`; | ||
const npmFilePath = args.global ? `${HOME_DIR}/.npmrc` : `./.npmrc`; | ||
if(!args.global) { | ||
if(existsSync("./.gitignore")) { | ||
if(readFileSync('./.gitignore').indexOf(".npmrc") === -1) { | ||
appendFileSync('./.gitignore', '\n.npmrc'); | ||
} | ||
} | ||
else { | ||
writeFileSync('./.gitignore', '.npmrc\n'); | ||
} | ||
} | ||
@@ -36,0 +46,0 @@ if(existsSync(npmFilePath)){ |
{ | ||
"name": "gt-starter-npmrc", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "GreenTeam starter script for .npmrc", | ||
@@ -5,0 +5,0 @@ "bin": { |
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
3677
46