Skip to content

Commit

Permalink
(#421) Allow preview scripts to run
Browse files Browse the repository at this point in the history
This fixes a few small errors in the preview scripts to allow them to
run as they are intended. There was a `)` in the wrong place that has
been moved. In addition, the docs site has been allowed to run on
Windows but still prevent Statiq sites from running.
  • Loading branch information
st3phhays committed Sep 26, 2024
1 parent cc1ec31 commit a06d960
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/preview-choco-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const init = async () => {
// Handle stdout data event
childProcess.stdout.on('data', data => {
const output = data.toString().trim();
if (output.includes('🎉 choco-theme complete' || output.startsWith('[nodemon] restarting due to changes...'))) {
if (output.includes('🎉 choco-theme complete') || output.startsWith('[nodemon] restarting due to changes...')) {
// Stop loading animation for this script
clearInterval(loadingIntervals[index]);
process.stdout.write('\r✅ ');
Expand Down
11 changes: 6 additions & 5 deletions build/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const init = async () => {
const folderPath = path.join(__dirname, '../../', folderName);
const port = folderConfig.port;

if (isWindows && !folderIsAstro) {
console.log(`⛔ This script does not currently run on Windows for ${folderName}.`);
clearInterval(loadingIntervals[index]);
}

if (folderIsAstro) {
const childProcessTwo = spawn('yarn dev', [], {
shell: true,
Expand Down Expand Up @@ -165,8 +170,4 @@ const init = async () => {
}
};

if (isWindows) {
console.log('⛔ This script does not currently run on Windows.');
} else {
init();
}
init();

0 comments on commit a06d960

Please sign in to comment.