replace-json-property
Advanced tools
Comparing version 1.6.3 to 1.7.0
@@ -17,8 +17,13 @@ #!/usr/bin/env node | ||
) | ||
.option( | ||
'--silent [boolean]', | ||
'Silent mode. Executes without log messages "\\r\\n"' | ||
) | ||
.action(function(path, property, value) { | ||
replaceJsonProperty.replace(path, property, value, { | ||
spaces: commander.spaces, | ||
EOL: commander.eol | ||
EOL: commander.eol, | ||
silent: commander.silent | ||
}); | ||
}) | ||
.parse(process.argv); |
{ | ||
"name": "replace-json-property", | ||
"version": "1.6.3", | ||
"version": "1.7.0", | ||
"description": "CLI tool to replace a property in a JSON file", | ||
@@ -5,0 +5,0 @@ "main": "src/replace-json-property.js", |
@@ -6,3 +6,4 @@ const jsonfile = require('jsonfile'); | ||
spaces: 2, | ||
EOL: '\n' | ||
EOL: '\n', | ||
SILENT: false | ||
}; | ||
@@ -15,3 +16,4 @@ | ||
: DEFAULT_OPTIONS.spaces, | ||
EOL: (options && options.EOL) || DEFAULT_OPTIONS.EOL | ||
EOL: (options && options.EOL) || DEFAULT_OPTIONS.EOL, | ||
silent: (options && options.silent) || DEFAULT_OPTIONS.SILENT | ||
}; | ||
@@ -21,5 +23,7 @@ try { | ||
jsonfile.writeFileSync(path, file, options); | ||
log.success( | ||
`Property: "${property}" in file: ${path} successfully overwritten with "${newValue}"` | ||
); | ||
if (!options.silent) { | ||
log.success( | ||
`Property: "${property}" in file: ${path} successfully overwritten with "${newValue}"` | ||
); | ||
} | ||
} catch (error) { | ||
@@ -26,0 +30,0 @@ log.error(error); |
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
7526
74