-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: windows support for cca #205
Conversation
@@ -166,7 +166,7 @@ export const createGitApp = (repo: string, version: string) => { | |||
|
|||
|
|||
// Construct the file path | |||
const relativeFilePath = templateFile.split(join(folderName, template) + sep)[1]; | |||
const relativeFilePath = templateFile.split((join(folderName, template) + '/').replace(/\\/g,'/'))[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this to the util and use it everywhere please
const posixPath = require('path').posix;
function toPosixPath(mixedPath) {
return mixedPath.replace(/\/g, posixPath.sep);
}
@@ -196,7 +196,7 @@ export const createGitApp = (repo: string, version: string) => { | |||
const closestPkgJson = [] | |||
.concat(glob(join(currentDirectory, name, '**', 'package.json'))) | |||
.reduce((shortest, current) => { | |||
return current.split(sep).length < shortest.split(sep).length ? current : shortest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to use the constant sep from 'const posixPath = require('path').posix;'
@@ -130,3 +131,7 @@ export const getPackageLicAndAccessInfo = async (results) => { | |||
}; | |||
} | |||
|
|||
export const glob = (input) => { | |||
return globSync(input.replace(/\\/g,'/')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's put a comment here — something about windows support.
035954c
to
2c6eae2
Compare
2c6eae2
to
c10edda
Compare
c10edda
to
a314693
Compare
No description provided.