@mikeyt23/node-cli-utils 1.2.4 → 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 -3
  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)) {
@@ -192,7 +194,7 @@ async function createTarball(directoryToTarball, outputDirectory, tarballName, c
192
194
  if (!!cwd) {
193
195
  options.cwd = cwd
194
196
  }
195
-
197
+
196
198
  await tar.c(options, [directoryToTarball])
197
199
  }
198
200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikeyt23/node-cli-utils",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Some node cli utility functions",
5
5
  "author": "Mike Thompson",
6
6
  "license": "MIT",