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 bc3acc4 commit cc68403
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions fsxc/Fsxc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,15 @@ 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() }
"""

let autogeneratedFile = GetAutoGenerationTargets origScript "fs"
let initFile = GetAutoGenerationTargets origScript "init.fs"

let binFolder = autogeneratedFile.Directory

Expand All @@ -597,11 +599,19 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }

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

File.WriteAllText(
initFile.FullName,
initialFileContent
)

seq {

yield CompilerInput.SourceFile initFile

let startCommentInFSharp = "// "

for maybeDep in contents do
Expand Down

0 comments on commit cc68403

Please sign in to comment.