Skip to content

Commit

Permalink
fix: 3 fixes (#32)
Browse files Browse the repository at this point in the history
* chmod
* git commit message
* readme fix

Closes #31 , #28 , #29
  • Loading branch information
Bugs5382 committed Jan 1, 2024
2 parents c6bffa7 + ad44f15 commit be57b51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/modules/git.ts
Expand Up @@ -2,7 +2,7 @@ import childProcess from 'node:child_process'
import { promisify } from 'node:util'

/** @internal */
const execFile = promisify(childProcess.execFile)
export const execFile = promisify(childProcess.execFile)

/**
* Init Git
Expand All @@ -19,9 +19,9 @@ export async function init (folder: string, step: string): Promise<void> {
}
case 'post': {
await execFile('git', ['add', '.'], { cwd: folder })
await execFile('git', ['commit', '-m', '"chore: initial creation [ci skip]"'], { cwd: folder })
await execFile('git', ['commit', '-m', 'chore: initial creation [ci skip]'], { cwd: folder })
await execFile('git', ['switch', '--orphan', 'main'], { cwd: folder })
await execFile('git', ['commit', '--allow-empty', '-m', '"chore: initial creation [ci skip]"'], { cwd: folder })
await execFile('git', ['commit', '--allow-empty', '-m', 'chore: initial creation [ci skip]'], { cwd: folder })
await execFile('git', ['checkout', 'develop'], { cwd: folder })
await execFile('git', ['-u', 'origin', 'main', 'develop'])
break
Expand Down
3 changes: 3 additions & 0 deletions src/modules/template.ts
Expand Up @@ -2,6 +2,7 @@ import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { copyTemplateFiles } from './helpers.js'
import { GenerateInput } from './types.js'
import { execFile } from './git.js'

const dirName = path.dirname(fileURLToPath(import.meta.url))

Expand Down Expand Up @@ -83,6 +84,7 @@ export const generateTemplate = async (input: GenerateInput, replacement?: any):
replace: createReplace
}
)
await execFile('chmod', ['+x', 'bin/build-types.sh'], { cwd: process.cwd() })
// copy npm folder
await copyTemplateFiles(
path.join(dirName, '..', '..', 'template', 'npm-fastify-plugin'),
Expand All @@ -103,6 +105,7 @@ export const generateTemplate = async (input: GenerateInput, replacement?: any):
replace: createReplace
}
)
await execFile('chmod', ['+x', 'bin/build-types.sh'], { cwd: process.cwd() })
// copy npm folder
await copyTemplateFiles(
path.join(dirName, '..', '..', 'template', 'npm'),
Expand Down
2 changes: 1 addition & 1 deletion template/__shared__npm__/README.md
Expand Up @@ -31,4 +31,4 @@ They might be sans uppercase throughout the documentation, but they would have t

## License

Licensed under [<%- licence %>](LICENSE).
Licensed under [<%- license %>](LICENSE).

0 comments on commit be57b51

Please sign in to comment.