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 2b8bf4f commit 9e2a14e
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,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,17 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }

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

seq {
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 9e2a14e

Please sign in to comment.