Skip to content

Commit

Permalink
fix: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelAlev committed Apr 9, 2023
1 parent 3a94eab commit 861fd9e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/frontify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { globSync } from 'glob';
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
import { spawn } from 'node:child_process';
import { dirname, resolve } from 'node:path';
import { info } from '@actions/core';

const CONFIG_PATH = `${process.env.XDG_CONFIG_HOME}/frontify-cli-nodejs/config.json`;

Expand All @@ -14,17 +15,17 @@ export const deploy = async (
writeConfigFile(token, instanceDomain);

const appPaths = globSync(pathGlob);
console.log(`Found ${appPaths.length} apps for path "${pathGlob}":`);
console.log(`- ${appPaths.join('\n- ')}`);
info(`Found ${appPaths.length} apps for path "${pathGlob}":`);
info(`- ${appPaths.join('\n- ')}`);

if (appPaths.length === 0) {
throw new Error(`No apps found for path "${pathGlob}"!`);
}

for (const appPath of appPaths) {
console.log(`Start deploying "${appPath}" to ${instanceDomain}...`);
info(`Start deploying "${appPath}" to ${instanceDomain}...`);
await deployApp(appPath, extraArgs);
console.log(`Deployed "${appPath}"!`);
info(`Deployed "${appPath}"!`);
}
};

Expand Down

0 comments on commit 861fd9e

Please sign in to comment.