-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed
move
command not updating the library properly.
- Loading branch information
Showing
10 changed files
with
74 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ appsettings.*.json | |
|
||
.fake | ||
*.snap | ||
snap.login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace b0wter.Fbrary | ||
|
||
open System | ||
|
||
module GlobalConfig = | ||
|
||
let private directory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) | ||
let private file = "config.json" | ||
let globalConfigPath = IO.Path.combine (directory, file) | ||
|
||
type GlobalConfig = { | ||
LibraryFile: string | ||
} | ||
|
||
let deserialize (json: string) : GlobalConfig option = | ||
match Microsoft.FSharpLu.Json.Compact.tryDeserialize<GlobalConfig> json with | ||
| Choice1Of2 c -> Some c | ||
| Choice2Of2 _ -> None | ||
|
||
let tryLoad () = | ||
let tryRead = IO.readTextFromFile >> function | Ok c -> Some c | Error _ -> None | ||
|
||
if IO.File.exists globalConfigPath then | ||
globalConfigPath | ||
|> tryRead | ||
|> Option.bind deserialize | ||
else None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters