mirror of
https://github.com/Smaug123/nix-dotfiles
synced 2025-10-06 06:58:41 +00:00
Many updates (#16)
This commit is contained in:
@@ -87,8 +87,8 @@ type NixFile =
|
||||
| _ -> failwith "Unexpected number of '++'"
|
||||
|
||||
let verbatim, skipped =
|
||||
match pre.Split "\n" |> List.ofArray with
|
||||
| "{pkgs}:" :: "with pkgs.vscode-extensions;" :: " [" :: rest ->
|
||||
match pre.Split "\n" |> Seq.filter (fun s -> s <> "") |> List.ofSeq with
|
||||
| pkgsStr :: "with pkgs.vscode-extensions; [" :: rest when pkgsStr.Replace(" ", "") = "{pkgs}:" ->
|
||||
rest
|
||||
|> List.map (fun s ->
|
||||
if s.StartsWith '#' then Choice2Of2 (s.[2..].Trim()) else Choice1Of2 (s.Trim())
|
||||
@@ -146,7 +146,9 @@ let upgradeExtension (client : HttpClient) (e : Extension) : Extension Async =
|
||||
|> sprintf "[%s]"
|
||||
|> fun s -> JsonSerializer.Deserialize<Version array> (s, options)
|
||||
|> Seq.head
|
||||
return { e with Version = latestVersion.Version }
|
||||
if latestVersion.Version <> e.Version then
|
||||
return { e with Version = latestVersion.Version ; Sha256 = "sha256-/000+cQBqzb6QB5+AizlyIcjqNpZ86o2at885hOcro0=" }
|
||||
else return e
|
||||
}
|
||||
|
||||
let upgrade (nixFile : NixFile) : NixFile =
|
||||
@@ -170,7 +172,7 @@ module Program =
|
||||
File.ReadAllText sourceFile
|
||||
|> NixFile.Parse
|
||||
|> upgrade
|
||||
|> sprintf "%O"
|
||||
|> string<NixFile>
|
||||
|> fun s -> File.WriteAllText (sourceFile, s)
|
||||
|
||||
0
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user