Skip to content

Commit

Permalink
feat(docz-core): copy .env
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Nov 29, 2019
1 parent 432ea08 commit 51f7027
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/docz-core/src/bundler/machine/services/create-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ const writeEslintRc = async () => {
}
}

const copyDotEnv = () => {
const filename = '.env'
const filepath = path.join(paths.root, filename)
const dest = path.join(paths.docz, filename)

if (fs.pathExistsSync(filepath)) {
fs.copySync(filepath, dest)
}
}

const copyEslintIgnore = async () => {
const filename = '.eslintignore'
const filepath = path.join(paths.root, filename)
Expand Down Expand Up @@ -118,6 +128,7 @@ const writeGatsbyBrowser = async () =>
export const createResources = async (ctx: ServerMachineCtx) => {
try {
copyDoczRc(ctx.args.config)
copyDotEnv()
await copyAndModifyPkgJson(ctx)
await writeEslintRc()
await copyEslintIgnore()
Expand Down

0 comments on commit 51f7027

Please sign in to comment.