@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.
- package/index.js +5 -3
- 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
|
-
|
|
180
|
-
|
|
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
|
|