Skip to content

Commit 14911e3

Browse files
committed
Fix typo for postStartupScriptPath
1 parent d2c8ec2 commit 14911e3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

patched-vscode/src/vs/server/node/webClientServer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ export class WebClientServer {
498498
* Handles API requests to run the post-startup script in SMD.
499499
*/
500500
private async _handlePostStartupScriptInvocation(req: http.IncomingMessage, res: http.ServerResponse): Promise<void> {
501-
const postStartupScripPath = '/etc/sagemaker-ui/sagemaker_ui_post_startup.sh'
501+
const postStartupScriptPath = '/etc/sagemaker-ui/sagemaker_ui_post_startup.sh'
502502
const logPath = '/var/log/apps/post_startup_default.log';
503503
const logStream = fs.createWriteStream(logPath, { flags: 'a' });
504504

@@ -509,19 +509,19 @@ export class WebClientServer {
509509
//If postStartupScriptFile doesn't exist, it will throw FileNotFoundError (404)
510510
//If exists, it will start the execution and add the execution logs in logFile.
511511
try {
512-
if (fs.existsSync(postStartupScripPath)) {
512+
if (fs.existsSync(postStartupScriptPath)) {
513513
// Adding 0o755 to make script file executable
514-
fs.chmodSync(postStartupScripPath, 0o755);
514+
fs.chmodSync(postStartupScriptPath, 0o755);
515515

516-
const subprocess = spawn('bash', [`${postStartupScripPath}`], { cwd: '/' });
516+
const subprocess = spawn('bash', [`${postStartupScriptPath}`], { cwd: '/' });
517517
subprocess.stdout.pipe(logStream);
518518
subprocess.stderr.pipe(logStream);
519519

520520
res.statusCode = 200;
521521
res.setHeader('Content-Type', 'application/json');
522522
res.end(JSON.stringify({ 'success': 'true' }));
523523
} else {
524-
serveError(req, res, 500, 'Poststartup script file not found at ' + postStartupScripPath);
524+
serveError(req, res, 500, 'Poststartup script file not found at ' + postStartupScriptPath);
525525
}
526526
} catch (error) {
527527
serveError(req, res, 500, error.message);

patches/sagemaker-ui-post-startup.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts
5757
+ * Handles API requests to run the post-startup script in SMD.
5858
+ */
5959
+ private async _handlePostStartupScriptInvocation(req: http.IncomingMessage, res: http.ServerResponse): Promise<void> {
60-
+ const postStartupScripPath = '/etc/sagemaker-ui/sagemaker_ui_post_startup.sh'
60+
+ const postStartupScriptPath = '/etc/sagemaker-ui/sagemaker_ui_post_startup.sh'
6161
+ const logPath = '/var/log/apps/post_startup_default.log';
6262
+ const logStream = fs.createWriteStream(logPath, { flags: 'a' });
6363
+
@@ -68,19 +68,19 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts
6868
+ //If postStartupScriptFile doesn't exist, it will throw FileNotFoundError (404)
6969
+ //If exists, it will start the execution and add the execution logs in logFile.
7070
+ try {
71-
+ if (fs.existsSync(postStartupScripPath)) {
71+
+ if (fs.existsSync(postStartupScriptPath)) {
7272
+ // Adding 0o755 to make script file executable
73-
+ fs.chmodSync(postStartupScripPath, 0o755);
73+
+ fs.chmodSync(postStartupScriptPath, 0o755);
7474
+
75-
+ const subprocess = spawn('bash', [`${postStartupScripPath}`], { cwd: '/' });
75+
+ const subprocess = spawn('bash', [`${postStartupScriptPath}`], { cwd: '/' });
7676
+ subprocess.stdout.pipe(logStream);
7777
+ subprocess.stderr.pipe(logStream);
7878
+
7979
+ res.statusCode = 200;
8080
+ res.setHeader('Content-Type', 'application/json');
8181
+ res.end(JSON.stringify({ 'success': 'true' }));
8282
+ } else {
83-
+ serveError(req, res, 500, 'Poststartup script file not found at ' + postStartupScripPath);
83+
+ serveError(req, res, 500, 'Poststartup script file not found at ' + postStartupScriptPath);
8484
+ }
8585
+ } catch (error) {
8686
+ serveError(req, res, 500, error.message);

0 commit comments

Comments
 (0)