Skip to content

Commit

Permalink
feat: script for debugging site
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Sep 11, 2024
1 parent 2bbf7fb commit ee7c039
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .knosys/scripts/command/site.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { join: joinPath } = require('path');
const { execSync } = require('child_process');

const { resolveRootPath } = require('../helper');

const siteRoot = joinPath(resolveRootPath(), '.knosys/sites/default');

module.exports = {
execute: subCmd => {
if (subCmd !== 'start') {
return;
}

return execSync('npm run dev', { cwd: siteRoot, stdio: 'inherit' });
},
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"octokit": "^4.0.2"
},
"scripts": {
"pmc": "node .knosys/scripts pmc"
"pmc": "node .knosys/scripts pmc",
"site": "node .knosys/scripts site",
"start": "npm run site start"
}
}

0 comments on commit ee7c039

Please sign in to comment.