@mikeyt23/node-cli-utils 1.2.2 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -176,8 +176,10 @@ async function createTarball(directoryToTarball, outputDirectory, tarballName, c
176
176
  console.log('directory to create tarball from: ' + directoryToTarball)
177
177
  console.log('output will be: ' + tarballPath)
178
178
 
179
- if (!fs.existsSync(directoryToTarball)) {
180
- throw new Error('error: dirToTarball directory does not exist')
179
+ let normalizedDirectoryToTarball = !!cwd ? path.join(cwd, directoryToTarball) : directoryToTarball
180
+
181
+ if (!fs.existsSync(normalizedDirectoryToTarball)) {
182
+ throw new Error('error: dirToTarball directory does not exist: ' + normalizedDirectoryToTarball)
181
183
  }
182
184
 
183
185
  if (!fs.existsSync(outputDirectory)) {
@@ -189,9 +191,8 @@ async function createTarball(directoryToTarball, outputDirectory, tarballName, c
189
191
  }
190
192
 
191
193
  let options = { gzip: true, file: tarballPath }
192
-
193
194
  if (!!cwd) {
194
- options.C = cwd
195
+ options.cwd = cwd
195
196
  }
196
197
 
197
198
  await tar.c(options, [directoryToTarball])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikeyt23/node-cli-utils",
3
- "version": "1.2.2",
3
+ "version": "1.2.5",
4
4
  "description": "Some node cli utility functions",
5
5
  "author": "Mike Thompson",
6
6
  "license": "MIT",