summaryrefslogtreecommitdiff
path: root/tools/astro-vscode/scripts
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2021-05-17 13:29:51 -0500
committerGravatar GitHub <noreply@github.com> 2021-05-17 13:29:51 -0500
commitd8a78298f354e775c1a3ad8b2d44e372969b0c39 (patch)
tree97877434c95310eb155e54984397376c0024a284 /tools/astro-vscode/scripts
parent86ed94e0c6f602c4fab65e341c25279148fdb26c (diff)
downloadastro-d8a78298f354e775c1a3ad8b2d44e372969b0c39.tar.gz
astro-d8a78298f354e775c1a3ad8b2d44e372969b0c39.tar.zst
astro-d8a78298f354e775c1a3ad8b2d44e372969b0c39.zip
chore: add publish script to vscode (#216)
Diffstat (limited to 'tools/astro-vscode/scripts')
-rw-r--r--tools/astro-vscode/scripts/publish.mjs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/astro-vscode/scripts/publish.mjs b/tools/astro-vscode/scripts/publish.mjs
new file mode 100644
index 000000000..93a36e804
--- /dev/null
+++ b/tools/astro-vscode/scripts/publish.mjs
@@ -0,0 +1,41 @@
+import { promises as fs } from 'fs';
+import { fileURLToPath } from 'url';
+import execa from 'execa';
+
+/** Copies `astro-languageserver` to our file */
+async function publish() {
+ const p0 = execa('yarn', ['lerna', 'run', 'build', '--scope', 'astro-vscode', '--scope', 'astro-languageserver'], { all: true });
+ p0.all.setEncoding('utf8');
+ for await (const chunk of p0.all) {
+ console.log(chunk);
+
+ if (/lerna success/g.test(chunk)) {
+ break;
+ }
+
+ if (/ERROR/g.test(chunk)) {
+ process.exit(1);
+ }
+ }
+
+ await execa('npm', ['install']);
+
+ const p1 = execa('vsce', ['publish'], { all: true });
+
+ p1.all.setEncoding('utf8');
+ for await (const chunk of p1.all) {
+ console.log(chunk);
+
+ if (/DONE/g.test(chunk)) {
+ break;
+ }
+
+ if (/ERROR/g.test(chunk)) {
+ process.exit(1);
+ }
+ }
+
+ p1.kill();
+}
+
+publish();