-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix initial installation on windows (#18241)
- Loading branch information
Showing
6 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const fg = require('fast-glob') | ||
const fs = require('fs-extra') | ||
const chalk = require('chalk') | ||
const path = require('path') | ||
const program = require('commander') | ||
|
||
program | ||
.command('copy-to [destination]') | ||
.description('copy ./src/**/*.template.js into destination') | ||
.action(async (destination) => { | ||
const srcPath = path.resolve(__dirname, '..', 'src') | ||
const destinationPath = path.resolve(process.cwd(), destination) | ||
|
||
const templates = await fg('**/*.template.js', { | ||
cwd: srcPath, | ||
onlyFiles: true, | ||
unique: true, | ||
}) | ||
|
||
const srcOuput = './src/' | ||
let destinationOuput = destination.replace('/\\/g', '/') | ||
|
||
if (!destinationOuput.endsWith('/')) { | ||
destinationOuput += '/' | ||
} | ||
|
||
const relOutput = (template, forSource) => { | ||
return `${forSource ? srcOuput : destinationOuput}${template}` | ||
} | ||
|
||
const result = await Promise.all(templates.map(async (template) => { | ||
await fs.copy(path.join(srcPath, template), path.join(destinationPath, template)) | ||
|
||
return () => console.log(`✅ ${relOutput(template, true)} successfully copied to ${chalk.cyan(relOutput(template, false))}`) | ||
})) | ||
|
||
result.forEach((r) => r()) | ||
}) | ||
|
||
program.parse(process.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
853a6f5
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.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
853a6f5
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.
AppVeyor has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
853a6f5
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.
AppVeyor has built the
win32 ia32
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
853a6f5
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.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: