feat: local secrets (#28)

This commit is contained in:
Morten Olsen
2024-01-14 09:45:10 +01:00
committed by GitHub
parent c8e02d8da4
commit c7ca97f041
4 changed files with 37 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import { resolve } from 'path';
import { run as runLoad } from '@morten-olsen/mini-loader-runner';
import { bundle } from '../../bundler/bundler.js';
import { step } from '../../utils/step.js';
import { readSecrets } from './local.utils.js';
const run = new Command('run');
@@ -12,12 +13,14 @@ run
.action(async (script) => {
const location = resolve(script);
const { autoInstall } = run.opts();
const secrets = await readSecrets();
const code = await step('Bundling', async () => {
return await bundle({ entry: location, autoInstall });
});
const { promise, emitter } = await runLoad({
script: code,
secrets,
});
emitter.addListener('message', (message) => {
switch (message.type) {