Skip to content

Commit

Permalink
feat: remove git folder in new repo after clone
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksteamdev committed Dec 22, 2020
1 parent 1708bec commit a2c5e8c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,20 @@ prompts([

await exec(`git clone ${repoUrls[lang]} ${name}`)

const packagePath = path.join(process.cwd(), name, 'package.json')
const packageDir = path.join(process.cwd(), name)
const packageJsonPath = path.join(packageDir, 'package.json')

const {
bugs,
homepage,
keywords,
license,
repository,
...packageJson
} = await fs.readJSON(packagePath)
} = await fs.readJSON(packageJsonPath)

await fs.writeJSON(
packagePath,
packageJsonPath,
sortPackageJson({
...packageJson,
author,
Expand All @@ -97,6 +99,9 @@ prompts([
{ spaces: 2 },
)

const gitFolderPath = path.join(packageDir, '.git')
await fs.remove(gitFolderPath)

console.log(
'Success: Now just `npm install` using your favorite package manager and create your Chrome extension!',
)
Expand Down

0 comments on commit a2c5e8c

Please sign in to comment.