Skip to content

Commit

Permalink
Fix #2522
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsogarciacaro committed Sep 6, 2021
1 parent e1eeedd commit 4d9172e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Fable.Cli/Entry.fs
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,21 @@ type Runner =
else
Ok fsprojPath

// TODO: Remove this check when typed arrays are compatible with typescript
|> Result.bind (fun projFile ->
let language = argLanguage args
let typedArrays = tryFlag "--typedArrays" args |> Option.defaultValue true
if language = TypeScript && typedArrays then
let outDir = argValueMulti ["-o"; "--outDir"] args |> Option.map normalizeAbsolutePath
let outDirLast = outDir |> Option.bind (fun outDir -> outDir.TrimEnd('/').Split('/') |> Array.tryLast) |> Option.defaultValue ""
if outDirLast = ".fable" then
Error(".fable is a reserved directory, please use another output directory")
// TODO: Remove this check when typed arrays are compatible with typescript
elif language = TypeScript && typedArrays then
Error("Typescript output is currently not compatible with typed arrays, pass: --typedArrays false")
else
Ok(projFile, language, typedArrays)
Ok(projFile, outDir, language, typedArrays)
)

|> Result.bind (fun (projFile, language, typedArrays) ->
|> Result.bind (fun (projFile, outDir, language, typedArrays) ->
let verbosity =
if flagEnabled "--verbose" args then
Log.makeVerbose()
Expand Down Expand Up @@ -182,7 +186,7 @@ type Runner =
FableLibraryPath = argValue "--fableLib" args
RootDir = rootDir
Configuration = configuration
OutDir = argValueMulti ["-o"; "--outDir"] args |> Option.map normalizeAbsolutePath
OutDir = outDir
SourceMaps = flagEnabled "-s" args || flagEnabled "--sourceMaps" args
SourceMapsRoot = argValue "--sourceMapsRoot" args
NoRestore = flagEnabled "--noRestore" args
Expand Down

0 comments on commit 4d9172e

Please sign in to comment.