-
Notifications
You must be signed in to change notification settings - Fork 24
Start workspaces by shelling out to CLI #400
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
Changes from 4 commits
59ac05c
cdccb52
8cdbd3a
437483e
4a03dc5
1230ee5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -405,6 +405,20 @@ export class Storage { | |
* The caller must ensure this directory exists before use. | ||
*/ | ||
public getSessionTokenPath(label: string): string { | ||
return label | ||
? path.join(this.globalStorageUri.fsPath, label, "session") | ||
: path.join(this.globalStorageUri.fsPath, "session") | ||
} | ||
|
||
/** | ||
* Return the directory for the deployment with the provided label to where | ||
* its session token was stored by older code. | ||
* | ||
* If the label is empty, read the old deployment-unaware config instead. | ||
* | ||
* The caller must ensure this directory exists before use. | ||
*/ | ||
public getLegacySessionTokenPath(label: string): string { | ||
return label | ||
? path.join(this.globalStorageUri.fsPath, label, "session_token") | ||
: path.join(this.globalStorageUri.fsPath, "session_token") | ||
|
@@ -488,6 +502,24 @@ export class Storage { | |
} | ||
} | ||
|
||
/** | ||
* Migrate the session token file from "session_token" to "session", if needed. | ||
*/ | ||
public async migrateSessionToken(label: string) { | ||
const oldTokenPath = this.getLegacySessionTokenPath(label) | ||
try { | ||
await fs.stat(oldTokenPath) | ||
const newTokenPath = this.getSessionTokenPath(label) | ||
await fs.rename(oldTokenPath, newTokenPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker at all, just wanted to mention that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, that makes sense. Removed the |
||
return | ||
} catch (error) { | ||
if ((error as NodeJS.ErrnoException)?.code === "ENOENT") { | ||
return | ||
} | ||
throw error | ||
} | ||
} | ||
|
||
/** | ||
* Run the header command and return the generated headers. | ||
*/ | ||
|
Uh oh!
There was an error while loading. Please reload this page.