Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
snorreks committed Jun 11, 2024
1 parent f849910 commit 81347aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nx-cloud-functions-deployer",
"type": "module",
"version": "2.5.5",
"version": "2.6.2",
"description": "Nx plugin to manage firebase functions v2",
"license": "MIT",
"main": "index.js",
Expand Down
12 changes: 10 additions & 2 deletions src/utils/execute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { PackageManager } from '$types';
import { logger } from './logger';

type Environment = Record<string, string | undefined>;

export const execute = async (options: {
Expand Down Expand Up @@ -81,7 +80,16 @@ export const runCommand = async (options: {
silent,
} = options;
try {
const { execa } = await import('execa');
// Dynamically import execa
const execaModule = await import('execa');
const execa = ((execaModule.default as unknown) ??
execaModule.execa) as typeof import('execa').execa;

if (typeof execa !== 'function') {
throw new Error(
'execa is not a function. Please check the import.',
);
}

const subprocess = execa(command, commandArguments, {
cwd,
Expand Down

0 comments on commit 81347aa

Please sign in to comment.