Skip to content

Commit

Permalink
fix: use binaries from editor node_modules in case they are not insta…
Browse files Browse the repository at this point in the history
…lled in the scene (#65)

* fix: use binaries from editor node_modules in case they are not installed in the scene

* chore: improve logs
  • Loading branch information
cazala authored Aug 9, 2024
1 parent d042646 commit 1c16730
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ if (import.meta.env.PROD) {
log.info('[AutoUpdater] Update not available');
});
updater.autoUpdater.on('update-downloaded', async info => {
log.info('[AutoUpdater] Update downloaded');
log.info(`[AutoUpdater] Update downloaded (v${info.version})`);
await track('Auto Update Editor', { version: info.version });
});
updater.autoUpdater.on('download-progress', info => {
log.info(`[AutoUpdater] Download progress ${info.percent}%`);
log.info(`[AutoUpdater] Download progress ${info.percent.toFixed(2)}%`);
});
updater.autoUpdater.on('error', err => {
log.error('[AutoUpdater] Error in auto-updater', err);
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/modules/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export async function install() {
// install dependencies using npm
log.info('[Install] Installing node_modules...');
const npmInstall = run('npm', 'npm', {
args: ['install'],
args: ['install', '--loglevel', 'error'],
cwd: APP_UNPACKED_PATH,
workspace,
});
Expand Down Expand Up @@ -229,7 +229,7 @@ export function run(pkg: string, bin: string, options: RunOptions = {}): Child {

const ready = future<void>();

const name = `${pkg} ${args.join(' ')}`.trim();
const name = `${bin} ${args.join(' ')}`.trim();
forked.on('spawn', () => {
log.info(
`[UtilityProcess] Running "${name}" using bin=${binPath} with pid=${forked.pid} in ${cwd}`,
Expand Down
4 changes: 1 addition & 3 deletions packages/main/src/modules/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ export async function start(path: string) {
if (previewServer) {
await previewServer.kill();
}
const installCommand = run('npm', 'npm', { args: ['install'], cwd: path });
const installCommand = run('npm', 'npm', { args: ['install', '--loglevel', 'error'], cwd: path });
await installCommand.wait();
const port = await getAvailablePort();
previewServer = run('@dcl/sdk-commands', 'sdk-commands', {
args: ['start', '--port', port.toString(), '--no-browser'],
cwd: path,
workspace: path,
});
await previewServer.waitFor(/available/i);
return port;
Expand All @@ -42,7 +41,6 @@ export async function deploy({ path, target, targetContent }: DeployOptions) {
...(targetContent ? ['--target-content', targetContent] : []),
],
cwd: path,
workspace: path,
});

// App ready at
Expand Down

0 comments on commit 1c16730

Please sign in to comment.