Skip to content

Improve readability of generated script #71

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

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/matlab.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 The MathWorks, Inc.
// Copyright 2020-2025 The MathWorks, Inc.

import { promises as fs } from "fs";
import * as os from "os";
Expand Down
4 changes: 2 additions & 2 deletions src/script.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 The MathWorks, Inc.
// Copyright 2020-2025 The MathWorks, Inc.

/**
* Generate MATLAB command for changing directories and calling a command in it.
Expand All @@ -8,7 +8,7 @@
* @returns MATLAB command.
*/
export function cdAndCall(command: string): string {
return `cd(getenv('MW_ORIG_WORKING_FOLDER'));${command}`;
return `cd(getenv('MW_ORIG_WORKING_FOLDER')); ${command}`;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/script.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2020-2023 The MathWorks, Inc.
// Copyright 2020-2025 The MathWorks, Inc.

import * as script from "./script";

describe("call generation", () => {
it("ideally works", () => {
// I know what your thinking
const testCommand = "disp('hello world')";
const expectedString = `cd(getenv('MW_ORIG_WORKING_FOLDER'));${testCommand}`;
const expectedString = `cd(getenv('MW_ORIG_WORKING_FOLDER')); ${testCommand}`;

expect(script.cdAndCall(testCommand)).toMatch(expectedString);
});
Expand Down