Palash Bansal пре 1 година
родитељ
комит
2585c0fb57
No account linked to committer's email address
4 измењених фајлова са 11 додато и 9 уклоњено
  1. 1
    1
      scripts/build-plugins.mjs
  2. 2
    1
      scripts/each-plugin.mjs
  3. 3
    2
      scripts/update-version.mjs
  4. 5
    5
      scripts/utils.mjs

+ 1
- 1
scripts/build-plugins.mjs Прегледај датотеку

@@ -1,4 +1,4 @@
import {execEachPlugin} from "./utils.mjs";
import {execEachPlugin} from './utils.mjs';

// Each plugin should have "prepare" that will also build the plugin
execEachPlugin('npm ci') // install dependencies

+ 2
- 1
scripts/each-plugin.mjs Прегледај датотеку

@@ -1,4 +1,4 @@
import {execEachPlugin} from "./utils.mjs";
import {execEachPlugin} from './utils.mjs';

const command = process.argv.slice(2).join(' ')
if(!command) throw new Error('Command is required')
@@ -6,3 +6,4 @@ console.log(`Executing '${command}' in all plugins`)

// Each plugin should have "prepare" that will also build the plugin
execEachPlugin(`npm ${command}`) // install dependencies


+ 3
- 2
scripts/update-version.mjs Прегледај датотеку

@@ -2,6 +2,7 @@

// in nodejs

import {writeFileSync} from "node:fs"
import {writeFileSync} from 'node:fs'

writeFileSync('src/viewer/version.ts', `export const VERSION = '${process.env.npm_package_version}'\n`)

writeFileSync("src/viewer/version.ts", `export const VERSION = '${process.env.npm_package_version}'\n`)

+ 5
- 5
scripts/utils.mjs Прегледај датотеку

@@ -1,8 +1,8 @@
import path from "node:path";
import fs from "node:fs";
import {execSync} from "node:child_process";
import path from 'node:path';
import fs from 'node:fs';
import {execSync} from 'node:child_process';

export function loopPluginDirs(callback){
export function loopPluginDirs (callback) {
const pathname = new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:\/)/, '$1')
const __dirname = path.dirname(pathname);
const pluginsDir = path.resolve(__dirname, '../plugins')
@@ -17,7 +17,7 @@ export function loopPluginDirs(callback){

}

export function execEachPlugin(command, templates = false){
export function execEachPlugin (command, templates = false) {
loopPluginDirs((pluginDir, pluginFolder) => {
if(!templates && pluginFolder.startsWith('plugin-template-')) return;
console.log(`Executing ${command} in ${pluginDir}`)

Loading…
Откажи
Сачувај