Skip to content

Commit

Permalink
fix asset spawning logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnoble committed Jan 17, 2024
1 parent f2597f1 commit 8d333f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ async function loadAssets(context: Context, assets?: string[]) {

if (import.meta.url.startsWith('file:')) {
const modulePath = fileURLToPath(import.meta.url);
if (process.argv[1] === modulePath) {
const executePath = process.argv[1];

if (executePath === modulePath) {
const context = makeTerafoundationContext() as unknown as Context;
const assets = safeDecode(process.env.ASSETS as string);

Expand Down
3 changes: 2 additions & 1 deletion packages/teraslice/src/lib/workers/assets/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { makeLogger } from '../helpers/terafoundation.js';
import { safeEncode } from '../../utils/encoding_utils.js';

const filePath = fileURLToPath(new URL('.', import.meta.url));
const loaderPath = path.join(filePath, './loader-executable');
const loaderPath = path.join(filePath, './loader-executable.js');

interface AssetMessage {
success: boolean;
Expand All @@ -20,6 +20,7 @@ export async function spawnAssetLoader(
context?: Context
): Promise<string[]> {
// if assets is empty return early
console.log('1', assets)
if (isEmpty(assets)) {
return [];
}
Expand Down

0 comments on commit 8d333f6

Please sign in to comment.