Skip to content

Commit 93a3089

Browse files
committed
fix(create): use relative file pathes in deployment generator
1 parent b0630b5 commit 93a3089

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

packages/create/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rocket/create",
3-
"version": "0.0.8",
3+
"version": "0.0.10",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -32,6 +32,7 @@
3232
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
3333
},
3434
"files": [
35+
"deployments",
3536
"dist",
3637
"dist-types",
3738
"src"

packages/create/src/deployment-generator.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
import { existsSync, readFileSync, writeFileSync } from 'fs';
2-
import { mkdir } from 'fs/promises';
1+
import { existsSync } from 'fs';
2+
import { mkdir, readFile, writeFile } from 'fs/promises';
33
import path from 'path';
44
import { blue } from 'colorette';
55

66
const GITHUB_ACTION_FILE_PATH = '.github/workflows';
77
const GITHUB_DEPLOYMENT_FILE_NAME = 'github-build-and-deploy-rocket-action.yml';
8-
const GITHUB_DEPLOYMENT_FILE_PATH = `./deployments/github-pages/${GITHUB_DEPLOYMENT_FILE_NAME}`;
8+
const GITHUB_DEPLOYMENT_FILE_PATH = `../deployments/github-pages/${GITHUB_DEPLOYMENT_FILE_NAME}`;
99

1010
export async function generateGithubActionsDeployment(newFolderPath) {
1111
console.log(`${blue('>')} Generating deployment actions...`);
1212

1313
const githubActionsPath = path.join(newFolderPath, GITHUB_ACTION_FILE_PATH);
1414
await createDeploymentsFolder(githubActionsPath);
1515

16-
const githubDeploymentFile = readFileSync(path.join('.', GITHUB_DEPLOYMENT_FILE_PATH));
16+
const githubDeploymentFile = await readFile(
17+
new URL(GITHUB_DEPLOYMENT_FILE_PATH, import.meta.url),
18+
);
1719

1820
const githubDeploymentFileTarget = path.join(
19-
'.',
21+
process.cwd(),
2022
newFolderPath,
2123
GITHUB_ACTION_FILE_PATH,
2224
GITHUB_DEPLOYMENT_FILE_NAME,
2325
);
24-
writeFileSync(githubDeploymentFileTarget, githubDeploymentFile);
26+
await writeFile(githubDeploymentFileTarget, githubDeploymentFile);
2527
}
2628

2729
async function createDeploymentsFolder(deploymentsPath) {

packages/search/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rocket/search",
3-
"version": "0.6.0-alpha.0",
3+
"version": "0.6.0-alpha.1",
44
"publishConfig": {
55
"access": "public"
66
},

0 commit comments

Comments
 (0)