diff --git a/fsxc/Fsxc.fs b/fsxc/Fsxc.fs index a1ef05b..989a651 100644 --- a/fsxc/Fsxc.fs +++ b/fsxc/Fsxc.fs @@ -580,13 +580,15 @@ module Program = | Some location -> location #endif - let initialInjectedContents = - """module FsxScript + let initialFileContent = + """[] +module FsxScriptInit type FsiStub = { CommandLineArgs: array } let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() } """ let autogeneratedFile = GetAutoGenerationTargets origScript "fs" + let initFile = GetAutoGenerationTargets origScript "init.fs" let binFolder = autogeneratedFile.Directory @@ -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