Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion packages/sitevision-scripts/scripts/create-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { getAddonEndpoint, handleResponse } from './util/requests.js';

handleResponse({ response, operation: 'Addon creation' });
} catch (err) {
console.error(`${chalk.red('Addon creation failed:')}, ${err}`);
console.error(chalk.red('Addon creation failed:'), err);
process.exit(1);
}
})();
3 changes: 2 additions & 1 deletion packages/sitevision-scripts/scripts/deploy-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ const activateCustomModuleExecutable = async (
);
}
} catch (err) {
console.log(`${chalk.red('Upload failed, status code:')} ${err}`);
console.error(chalk.red('Could not deploy app:'), err);
process.exit(1);
}
}
);
Expand Down
3 changes: 2 additions & 1 deletion packages/sitevision-scripts/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { getFullAppId } from './util/id.js';

handleResponse({ response, operation: 'Upload' });
} catch (err) {
console.log(`${chalk.red('Upload failed, status code:')} ${err}`);
console.error(chalk.red('Could not deploy app:'), err);
process.exit(1);
}
})();
8 changes: 7 additions & 1 deletion packages/sitevision-scripts/scripts/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import webpack from 'webpack';
import { copyChunksToResources } from './util/copychunks.js';
import { getDirname } from '../util/dirname.js';
import { getFullAppId } from './util/id.js';
import chalk from 'chalk';

const __dirname = getDirname(import.meta.url);

Expand Down Expand Up @@ -51,11 +52,16 @@ const SPAWN_PROPERTIES = {
copyChunksToResources(properties.BUILD_DIR_PATH);

spawn.sync('node', [SITEVISION_SCRIPTS_PATH, 'zip'], SPAWN_PROPERTIES);
spawn.sync(
const result = spawn.sync(
'node',
[SITEVISION_SCRIPTS_PATH, 'deploy', 'force'],
SPAWN_PROPERTIES
);

if (result.status !== 0) {
console.error(`${chalk.red('Could not deploy app, stopping watch')}`);
process.exit(1);
}
}
);

Expand Down
1 change: 1 addition & 0 deletions packages/sitevision-scripts/scripts/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import { getFullAppId } from './util/id.js';
}
} catch (err) {
console.log(`${chalk.red('Signing failed with error:')} ${err}`);
process.exit(1);
}
});
})();
4 changes: 2 additions & 2 deletions packages/sitevision-scripts/scripts/util/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ export const handleResponse = async ({ response, operation }) => {
}

if (json) {
console.log(
throw new Error(
`${chalk.red(`${operation} failed:`)} \n${JSON.stringify(json, null, 2)}`
);
} else {
console.log(
throw new Error(
`${chalk.red(`${operation} failed with status:`)} ${
response.status
} ${getHintByErrorCode(response.status)}`
Expand Down