Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/deployment/source-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import fs from 'node:fs';
import fsp from 'node:fs/promises';
import os from 'node:os';
import util from 'node:util';
import { exec } from 'node:child_process';
import { execFile } from 'node:child_process';
import { TEMP_PATHS, RUNTIMES } from './constants.js';
import { logAndProgress } from '../util/helpers.js';

const execAsync = util.promisify(exec);
const execFileAsync = util.promisify(execFile);

/**
* Prepares a temporary directory with the source code for deployment.
Expand All @@ -48,7 +48,7 @@ export async function prepareSourceDirectory(files, progressCallback) {
const stats = await fsp.stat(file);
if (stats.isDirectory()) {
// Copy directory contents
await execAsync(`cp -R "${file}/." "${tempDir}/"`);
await execFileAsync('cp', ['-R', `${file}/.`, `${tempDir}/`]);
} else {
const destPath = path.join(tempDir, path.basename(file));
await fsp.copyFile(file, destPath);
Expand Down
11 changes: 7 additions & 4 deletions lib/deployment/universal-maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { exec } from 'child_process';
import { execFile } from 'child_process';
import fs from 'fs';
import path from 'path';
import os from 'os';
Expand All @@ -23,7 +23,7 @@ import { logAndProgress } from '../util/helpers.js';
import { TEMP_PATHS } from './constants.js';
import { ensureRepositoryDownloaded } from '../util/artifacts.js';

const execAsync = util.promisify(exec);
const execFileAsync = util.promisify(execFile);

const UNIVERSAL_MAKER_BIN = 'universal_maker';
const UM_VERSION = '1.0.0';
Expand Down Expand Up @@ -108,8 +108,11 @@ export async function runUniversalMaker(appDir, accessToken, progressCallback) {
progressCallback,
'debug'
);
const command = `"${binPath}" -application_dir "${appDir}" -output_dir "${outputDir}" -output_format json`;
await execAsync(command);
await execFileAsync(binPath, [
'-application_dir', appDir,
'-output_dir', outputDir,
'-output_format', 'json',
]);

const outputPath = path.join(outputDir, 'build_output.json');
if (fs.existsSync(outputPath)) {
Expand Down