Skip to content

Conversation

@GetPsyched
Copy link

Fixes #404

I personally don't like this approach as this breaks general expectations I'd have as a user. I better like (with bias) the approach I suggested here.

Marking this as draft until there's more discussion on the tracking issue.

@waffles-dev
Copy link
Collaborator

My suggestion in #404 was purely because it didn't fundamentally change the intent of that check.
I'm not wed to the suggestion - happy to change intent if Tibix or Levev approve.

const isWinboatPathCreated = false;
try {
fs.mkdirSync(winboatPath, { recursive: true });
isWinboatPathCreated = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this work when isWinboatPathCreated is a constant?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. That bool was a last-minute thing so it went untested

const diskSpace = await checkDiskSpace(parentPath);
const diskSpace = await checkDiskSpace(isWinboatPathCreated ? winboatPath : parentPath);
if (isWinboatPathCreated) {
await fs.rm(winboatPath, { recursive: true });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: Object literal may only specify known properties, and 'recursive' does not exist in type 'NoParamCallback`

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting; where are you seeing this error? I had a lot of trouble seeing any errors. I had to rely solely on if things worked or not.

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

Successfully merging this pull request may close these issues.

[Bug] Check disk space of actual directory instead of parent directory

2 participants