Skip to content

Commit

Permalink
WIP1
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Sep 5, 2024
1 parent ac9cfaf commit b1a3a69
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions fsxc/Fsxc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,9 @@ module Program =
| Some location -> location
#endif

let initialInjectedContents =
"""module FsxScript
let initialFileContent =
"""[<AutoOpen>]
module FsxScriptInit
type FsiStub = { CommandLineArgs: array<string> }
let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
"""
Expand All @@ -597,11 +598,18 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }

File.WriteAllText(
autogeneratedFile.FullName,
initialInjectedContents
"""module FsxScript
"""
)

seq {
let initFile = GetAutoGenerationTargets origScript "init.fs"
File.WriteAllText(initFile.FullName, initialFileContent)

seq {
// for !LEGACY_FRAMEWORK, this init file will be added to the fsproj file
#if LEGACY_FRAMEWORK
yield CompilerInput.SourceFile initFile
#endif
let startCommentInFSharp = "// "

for maybeDep in contents do
Expand Down

0 comments on commit b1a3a69

Please sign in to comment.