Skip to content

Commit

Permalink
Merge pull request #2427 from lf-lang/fix-ts-windows2
Browse files Browse the repository at this point in the history
File extension of TypeScript launch script adjusted on Windows
  • Loading branch information
lhstrh authored Oct 16, 2024
2 parents 26674cf + 54612a2 commit b76c063
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/src/main/kotlin/org/lflang/generator/ts/TSFileConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ package org.lflang.generator.ts

import org.eclipse.emf.ecore.resource.Resource
import org.lflang.FileConfig
import org.lflang.generator.GeneratorUtils
import org.lflang.util.FileUtil
import org.lflang.util.LFCommand
import java.io.IOException
Expand All @@ -53,4 +54,8 @@ class TSFileConfig(
super.doClean()
FileUtil.deleteDirectory(srcGenPath)
}

override fun getExecutableExtension(): String {
return if (GeneratorUtils.isHostWindows()) ".bat" else ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class TSGenerator(
context.unsuccessfulFinish()
} else {
context.finish(GeneratorResult.Status.COMPILED, codeMaps)
val shScriptPath = fileConfig.binPath.resolve(fileConfig.name)
val shScriptPath = fileConfig.executable
val jsPath = fileConfig.srcGenPath.resolve("dist").resolve("${fileConfig.name}.js")
FileUtil.writeToFile("#!/bin/sh\nnode $jsPath", shScriptPath)
shScriptPath.toFile().setExecutable(true)
Expand Down

0 comments on commit b76c063

Please sign in to comment.