Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions scripts/dev-apps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {execSync} = require('child_process');
const { exec } = require('child_process');

const devApp = process.argv[2];

Expand All @@ -7,12 +7,22 @@ const sequentialExecution = async (...commands) => {
return 0;
}

execSync(commands.shift(), {stdio: 'inherit'});
await new Promise((resolve, reject) => {
exec(commands.shift(), { stdio: 'inherit' }, (error, stdout, stderr) => {
if (error) {
reject(error);
return;
}
resolve(stdout);
});
});

return sequentialExecution(...commands);
};

sequentialExecution(
`pnpm turbo run build --filter=@${devApp}^...`,
`pnpm turbo run dev --filter=@${devApp}`
);
).catch((error) => {
console.error('Error executing command:', error);
});