Skip to content

Fix filename variable substitution to strip any extension#486

Merged
lemmy merged 1 commit intomasterfrom
mku-gh483
Feb 2, 2026
Merged

Fix filename variable substitution to strip any extension#486
lemmy merged 1 commit intomasterfrom
mku-gh483

Conversation

@lemmy
Copy link
Member

@lemmy lemmy commented Jan 30, 2026

When using ${modelName} or ${specName} in TLC custom options, the variables now correctly resolve to the base filename without extension, regardless of whether the file has a .cfg or .tla extension.

Previously, path.basename(file, '.ext') would only strip the specified extension, causing ${modelName}.dot to expand to "Model.tla.dot" when the config was embedded in a .tla file instead of the expected "Model.dot".

Now using path.parse(file).name which properly strips any extension.

Fixes Github issue #483
#483

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates TLC custom option variable substitution so ${specName} / ${modelName} resolve to the base filename without any extension (fixing cases like embedded CONFIG in a .tla producing HourClock.tla.dot).

Changes:

  • Replace path.basename(file, '.ext') with path.parse(file).name for ${specName} / ${modelName} expansion.
  • Ensures correct output filenames regardless of whether the model/config source is .cfg or embedded in .tla.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lemmy lemmy requested a review from Copilot January 30, 2026 21:56
@lemmy lemmy marked this pull request as ready for review January 30, 2026 21:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When using ${modelName} or ${specName} in TLC custom options, the
variables now correctly resolve to the base filename without extension,
regardless of whether the file has a .cfg or .tla extension.

Previously, path.basename(file, '.ext') would only strip the specified
extension, causing ${modelName}.dot to expand to "Model.tla.dot" when
the config was embedded in a .tla file instead of the expected
"Model.dot".

Now using path.parse(file).name which properly strips any extension.

Fixes Github issue #483
#483

[Bug]

Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@lemmy lemmy merged commit 794743a into master Feb 2, 2026
4 checks passed
@lemmy lemmy deleted the mku-gh483 branch February 2, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants