Force publish of headless even in PR
This commit is contained in:
+6
-2
@@ -6,6 +6,7 @@
|
|||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
const { basename } = require('path');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Setup auth
|
// Setup auth
|
||||||
@@ -22,6 +23,7 @@ const changedFiles = getChangedFilesInCommit('HEAD');
|
|||||||
let isStableRelease = false;
|
let isStableRelease = false;
|
||||||
if (changedFiles.some(e => e.search(/^addons\//) === -1)) {
|
if (changedFiles.some(e => e.search(/^addons\//) === -1)) {
|
||||||
isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..'));
|
isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..'));
|
||||||
|
checkAndPublishPackage(path.resolve(__dirname, '../headless'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Publish addons if any files were changed inside of the addon
|
// Publish addons if any files were changed inside of the addon
|
||||||
@@ -70,11 +72,13 @@ function checkAndPublishPackage(packageDir) {
|
|||||||
|
|
||||||
// Publish
|
// Publish
|
||||||
const args = ['publish'];
|
const args = ['publish'];
|
||||||
if (!isStableRelease) {
|
if (basename(packageDir) === 'headless') {
|
||||||
|
args.push('--tag', 'beta');
|
||||||
|
} else if (!isStableRelease) {
|
||||||
args.push('--tag', 'beta');
|
args.push('--tag', 'beta');
|
||||||
}
|
}
|
||||||
console.log(`Spawn: npm ${args.join(' ')}`);
|
console.log(`Spawn: npm ${args.join(' ')}`);
|
||||||
if (!isDryRun) {
|
if (!isDryRun || basename(packageDir) === 'headless') {
|
||||||
const result = cp.spawnSync('npm', args, {
|
const result = cp.spawnSync('npm', args, {
|
||||||
cwd: packageDir,
|
cwd: packageDir,
|
||||||
stdio: 'inherit'
|
stdio: 'inherit'
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { createRequire } from 'module';
|
import { createRequire } from 'module';
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const Terminal = require('../lib-headless/xterm.js').Terminal;
|
const Terminal = require('../headless/lib-headless/xterm.js').Terminal;
|
||||||
|
|
||||||
console.log('Creating xterm-headless terminal...');
|
console.log('Creating xterm-headless terminal...');
|
||||||
const terminal = new Terminal();
|
const terminal = new Terminal();
|
||||||
|
|||||||
Reference in New Issue
Block a user