Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tomcl/issie
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcl committed Mar 25, 2024
2 parents cbf6f18 + 900fe7f commit 8d6e72d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Renderer/Interface/FilesIO.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ let staticDir() =
/// on MacOs we think it should be ../Resources/static
/// we hope staticDir will give this?
let isMac = Node.Api.``process``.platform = Node.Base.Darwin
if productionBuild && not isMac then
"./resources/static"
elif productionBuild && isMac then
"./Resources/static"
else
if productionBuild && not isMac then
"./resources/static"
elif productionBuild && isMac then
path.join [|__dirname; ".."; ".."; "static"|]
else
staticDirFromStatic()

/// absolute path to repo directory ./static
Expand Down
7 changes: 5 additions & 2 deletions src/Renderer/UI/TopMenuView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,14 @@ let private openProject model dispatch =
/// load demo project into Issie executables
let loadDemoProject model dispatch basename =
warnAppWidth dispatch (fun _ ->
let newDir = "./demos/" + basename
let isMac = Node.Api.``process``.platform = Node.Base.Darwin
let homeDir = if isMac then pathJoin [|FilesIO.staticDir(); ".."; ".."|] else "."

let newDir = homeDir + "/demos/" + basename
let sourceDir = FilesIO.staticDir() + "/demos/" + basename
printf "%s" $"loading demo {sourceDir} into {newDir}"

ensureDirectory "./demos/"
ensureDirectory (homeDir + "/demos/")
ensureDirectory newDir

readFilesFromDirectory newDir
Expand Down

0 comments on commit 8d6e72d

Please sign in to comment.