Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create folder using async call #61

Open
amerharb opened this issue Mar 17, 2024 · 2 comments
Open

create folder using async call #61

amerharb opened this issue Mar 17, 2024 · 2 comments

Comments

@amerharb
Copy link
Collaborator

in file: webapp/src/RepoGit.ts a folder is created using fs.existsSync which is not recommended

  1. use different method that is async
  2. rename import fsp from ... back into import fs from ...
@a-jaxell
Copy link
Collaborator

Is this implemented?
I checked and the only mkdir is using fsp and is within this function inside of RepoGit.ts

private static async clone(spConfig: ServerProjectConfig): Promise<void> {
    debug(`create directory: ${spConfig.repoPath} ...`);
    await fsp.mkdir(spConfig.repoPath, { recursive: true });
    const git = new SimpleGitWrapper(spConfig.repoPath);
    debug(`Cloning repo: ${spConfig.repoPath} ...`);
    await git.clone(spConfig.cloneUrl, spConfig.repoPath);
    debug(`Cloned repo: ${spConfig.repoPath}`);
    debug(`Checkout base branch: ${spConfig.baseBranch} ...`);
    await git.checkout(spConfig.baseBranch);
    debug(`Checked out base branch: ${spConfig.baseBranch}`);
  }

@WULCAN
Copy link
Collaborator

WULCAN commented Sep 29, 2024

Our use of existsSync is still there on

if (!fs.existsSync(spConfig.repoPath)) {

It is not exactly used to create a folder, but to avoid creating a new folder with clone, it a folder already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants