Skip to content

Commit

Permalink
Fixed file copy erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugos68 committed Sep 22, 2023
1 parent becbd73 commit e2aee5c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 41 deletions.
18 changes: 9 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/dry-candles-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'capkit': patch
---

Fixed files not being copied correctly
58 changes: 29 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Publish
on:
push:
branches:
- 'main'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Publish
on:
push:
branches:
- 'main'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@ async function initializeProject({
start: 'Copying hotreload scripts',
stop: 'Successfully copied hotreload scripts',
task: async () => {
if (existsSync('/scripts')) await fs.mkdir('./scripts');
const root = process.cwd() + '/';
if (existsSync(`${root}/scripts`)) await fs.mkdir(`${root}/scripts`);
return Promise.all([
fs.writeFile('./scripts/hotreload.js', String(await fs.readFile('./scripts/hotreload.js'))),
fs.writeFile(
'./scripts/hotreload-cleanup.js',
`${root}/scripts/hotreload.js`,
String(await fs.readFile('./scripts/hotreload.js'))
),
fs.writeFile(
`${root}/scripts/hotreload-cleanup.js`,
String(await fs.readFile('./scripts/hotreload-cleanup.js'))
)
]);
Expand Down

0 comments on commit e2aee5c

Please sign in to comment.