Skip to content

Commit

Permalink
fix: improve sync
Browse files Browse the repository at this point in the history
  • Loading branch information
William Luke committed Jan 4, 2021
1 parent 399d5cd commit a5160af
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ async function run() {


if (!cli.input[0] || cli.input[0] === "local") {
let synced = false
let projects = await client.project.findMany();
sync(currentUser).then((prjs) => {
projects = prjs;
});
if(projects.length <= 0){
projects = await sync(currentUser)
synced = true
}
// const argOutputDir = cli.input[0];
const { repo } = await inquirer.prompt([
{
Expand All @@ -126,6 +128,10 @@ async function run() {
});
}
}
if(!synced){
projects = await sync(currentUser)
synced = true
}
}
if (cli.input[0] === "template") {
const argOutputDir = cli.input[1];
Expand Down

0 comments on commit a5160af

Please sign in to comment.