Skip to content

Conversation

@jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Jan 10, 2023

  • chore(deps): add fs-extra
  • fix: ensure coder.coder-remote dir exists

This adds a handy function called `ensureDir` which creates a directory
if it doesn't yet exist.
This ensures the coder.coder-remote dir exists before writing a file to
the `globalStorageUri.fsPath`.

Fixes a bug occurring on macOS.
@jsjoeio jsjoeio changed the title jsjoeio/fix dir fix: ensure coder.coder-remote dir exists Jan 10, 2023
@jsjoeio jsjoeio requested a review from kylecarbs January 10, 2023 18:51
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

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

Just one small change!

const url = this.getURL()
axios.defaults.baseURL = url
if (url) {
await ensureDir(this.globalStorageUri.fsPath)
Copy link
Member

Choose a reason for hiding this comment

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

You should add this for the session token too!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good call. Let me do that now!

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Jan 10, 2023

@kylecarbs can I get write access to merge my own PRs?

@kylecarbs
Copy link
Member

Yup!

@kylecarbs kylecarbs merged commit edf3deb into main Jan 10, 2023
@kylecarbs kylecarbs deleted the jsjoeio/fix-dir branch January 10, 2023 20:02
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.

2 participants