gaffer-generator 2.0.18 → 2.1.0
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/lib/generate/root.js
CHANGED
|
@@ -6,6 +6,7 @@ import path from 'path';
|
|
|
6
6
|
import { pathToFileURL } from 'url';
|
|
7
7
|
import { getArgv } from '../argv.js';
|
|
8
8
|
import * as utils from '../utils.js';
|
|
9
|
+
import { isAbsolute } from '../utils/isAbsolute.js';
|
|
9
10
|
import { logError } from '../utils/logError.js';
|
|
10
11
|
import * as node from './node.js';
|
|
11
12
|
|
|
@@ -56,7 +57,7 @@ async function visit(rootPath) {
|
|
|
56
57
|
+ colors.cyan(templateSettingsPath));
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
const toPath = templateSettings.into[0]
|
|
60
|
+
const toPath = isAbsolute(templateSettings.into[0]) ? templateSettings.into : path.join(rootPath, templateSettings.into);
|
|
60
61
|
utils.log(colors.green('Running download from ') + colors.magenta(templateSettingsPath));
|
|
61
62
|
templateSettings.download(utils.fetch)
|
|
62
63
|
.catch(err => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
+
import { isAbsolute } from './isAbsolute.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* Normalizes a path across platforms. (Root / paths are assumed to be on C:\ on
|
|
5
|
+
* Normalizes a path across platforms. (Root / paths are assumed to be on C:\ on Windows).
|
|
5
6
|
* @param ref
|
|
6
7
|
* @returns {string}
|
|
7
8
|
*/
|
|
8
9
|
export function normalizePath(ref) {
|
|
9
|
-
return ref && ref
|
|
10
|
+
return ref && isAbsolute(ref) ? path.resolve(ref) : path.normalize(ref);
|
|
10
11
|
}
|
package/package.json
CHANGED