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 6f15704 commit 9078e65
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 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,16 @@ 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 9078e65

Please sign in to comment.