Skip to content

Commit

Permalink
Don't use yarn import because @arcanis says it's a bad idea
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Nov 24, 2020
1 parent f67ab9e commit c04b95a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
8 changes: 1 addition & 7 deletions packages/create-gatsby/src/init-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ const install = async (
}
}
if (getPackageManager() === `yarn` && checkForYarn()) {
if (await fs.pathExists(`package-lock.json`)) {
if (!(await fs.pathExists(`yarn.lock`))) {
await execa(`yarnpkg`, [`import`])
}
await fs.remove(`package-lock.json`)
}

await fs.remove(`package-lock.json`)
const args = packages.length ? [`add`, silent, ...packages] : [silent]
await execa(`yarnpkg`, args)
} else {
Expand Down
7 changes: 1 addition & 6 deletions packages/gatsby-cli/src/init-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,7 @@ const install = async (rootPath: string): Promise<void> => {
}
}
if (getPackageManager() === `yarn` && checkForYarn()) {
if (await fs.pathExists(`package-lock.json`)) {
if (!(await fs.pathExists(`yarn.lock`))) {
await spawn(`yarnpkg import`)
}
await fs.remove(`package-lock.json`)
}
await fs.remove(`package-lock.json`)
await spawn(`yarnpkg`)
} else {
await fs.remove(`yarn.lock`)
Expand Down

0 comments on commit c04b95a

Please sign in to comment.