Skip to content

Commit

Permalink
fix: packagejson not found
Browse files Browse the repository at this point in the history
Signed-off-by: Nabil Tharwat <[email protected]>
  • Loading branch information
KL13NT committed Jan 16, 2023
1 parent 54067db commit 7e53f3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,4 @@ lib/**/*
collections/

# Ignore output files
dist/
out/
20 changes: 9 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { execSync } from "child_process";
import * as core from "@actions/core";

import {
OUTPUT_DIR,
LECTURES_DIR,
COLLECTIONS_DIR,
TEMPLATE_DIR,
Expand All @@ -19,10 +18,6 @@ async function run(): Promise<void> {
);
core.info("Creating temporary and final build directory");

if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR, { recursive: true });
}

if (!fs.existsSync(LECTURES_DIR)) {
throw new Error(
'Lectures directory does not exist. Please create a "collections/lectures" directory in the root of your repo.'
Expand All @@ -36,17 +31,20 @@ async function run(): Promise<void> {
force: true,
});

core.info("cd into template directory");
process.chdir(TEMPLATE_DIR);

core.info("install template npm dependencies");
execSync("npm install --save-exact");
execSync("npm install --save-exact", {
cwd: TEMPLATE_DIR,
});

core.info("building website");
execSync("npm run build");
execSync("npm run build", {
cwd: TEMPLATE_DIR,
});

core.info("exporting website");
execSync("npm run export");
execSync("npm run export", {
cwd: TEMPLATE_DIR,
});

// core.info("outputting files to project out directory");
// const temp = fs.readdirSync(NEXT_OUT_DIR);
Expand Down

0 comments on commit 7e53f3d

Please sign in to comment.