diff --git a/index.js b/index.js index aa27e54..d6b0fbf 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ export async function octoherd( ); }, onLogData(data) { - appendFileSync(tmpLogFile, JSON.stringify(data)); + appendFileSync(tmpLogFile, JSON.stringify(data) + "\n"); }, }, }); @@ -66,6 +66,8 @@ export async function octoherd( let userScript; const path = resolve(process.cwd(), octoherdScript); + octokit.log.info("Loading script at %s", octoherdScript); + try { userScript = (await import(path)).script; } catch (error) { @@ -86,6 +88,7 @@ export async function octoherd( }; try { + octokit.log.info("Loading repositories ..."); const repositories = await resolveRepositories(state, octoherdRepos); for (const repository of repositories) { diff --git a/lib/resolve-repositories.js b/lib/resolve-repositories.js index 3877ea0..e912f40 100644 --- a/lib/resolve-repositories.js +++ b/lib/resolve-repositories.js @@ -25,6 +25,7 @@ export async function resolveRepositories(state, repositories) { repo, }); resolvedRepositories.push(data); + process.stdout.write("."); } for (const name of repositoriesWithStars) { @@ -51,6 +52,7 @@ export async function resolveRepositories(state, repositories) { } )) { resolvedRepositories.push(...response.data); + process.stdout.write("."); } } @@ -62,13 +64,11 @@ export async function resolveRepositories(state, repositories) { } )) { resolvedRepositories.push(...response.data); + process.stdout.write("."); } } - console.log(`resolvedRepositories`); - console.log(resolvedRepositories); - - process.exit(); + process.stdout.write("\n"); // return unique array (https://www.samanthaming.com/tidbits/43-3-ways-to-remove-array-duplicates/) return [...new Set(resolvedRepositories)];