Skip to content

Commit

Permalink
Update git clone command for template provider. (#4315)
Browse files Browse the repository at this point in the history
* Add type status hide/show system app.

Signed-off-by: zzjin <tczzjin@gmail.com>

* Fix typo

Signed-off-by: zzjin <tczzjin@gmail.com>

* Use shallow clone to speedup template  repo.

Signed-off-by: zzjin <tczzjin@gmail.com>

* Rebase app status.

Signed-off-by: zzjin <tczzjin@gmail.com>

---------

Signed-off-by: zzjin <tczzjin@gmail.com>
  • Loading branch information
zzjin committed Nov 20, 2023
1 parent e82b92f commit 881e165
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/providers/template/src/pages/api/updateRepo.ts
Expand Up @@ -45,8 +45,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
}, 60 * 1000);
});
const gitOperationPromise = !fs.existsSync(targetPath)
? execAsync(`git clone ${repoHttpUrl} ${targetPath}`)
: execAsync(`cd ${targetPath} && git pull`);
? execAsync(`git clone ${repoHttpUrl} ${targetPath} --depth=1`)
: execAsync(`cd ${targetPath} && git pull --depth=1`);

await Promise.race([gitOperationPromise, timeoutPromise]);
} catch (error) {
Expand Down

0 comments on commit 881e165

Please sign in to comment.