Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/checkCommits1by1.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ open System.Net.Http.Headers
#r "nuget: FSharp.Data, Version=5.0.2"
open FSharp.Data

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
2 changes: 1 addition & 1 deletion scripts/compileFSharpScripts.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
open System
open System.IO

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"
#load "../src/FileConventions/Helpers.fs"

Fsdk
Expand Down
2 changes: 1 addition & 1 deletion scripts/deleteAssetsFromOldReleases.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open System.Net.Http.Headers
#r "nuget: FSharp.Data, Version=5.0.2"
open FSharp.Data

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
2 changes: 1 addition & 1 deletion scripts/deleteOldArtifacts.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open System.Net.Http.Headers
#r "nuget: FSharp.Data, Version=5.0.2"
open FSharp.Data

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
2 changes: 1 addition & 1 deletion scripts/gitPush1by1.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open System.Threading
#r "System.Configuration"
open System.Configuration

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
2 changes: 1 addition & 1 deletion scripts/inconsistentNugetVersionsInDotNetProjects.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open System.IO
#r "System.Core.dll"
#r "System.Xml.Linq.dll"

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open System.IO
#r "System.Core.dll"
#r "System.Xml.Linq.dll"

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"
#r "nuget: Microsoft.Build, Version=16.11.0"
#r "nuget: Mono.Unix, Version=7.1.0-final.1.21458.1"
#r "nuget: YamlDotNet, Version=16.1.3"
Expand Down
57 changes: 57 additions & 0 deletions scripts/replace.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env -S dotnet fsi

open System
open System.IO

#r "System.Configuration"
open System.Configuration

#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"
open Fsdk

let args = Misc.FsxOnlyArguments()

let errTooManyArgs =
"Can only pass two arguments, with optional flag: replace.fsx --file=a.b oldstring newstring"

let note =
"NOTE: by default, some kind of files/folders will be excluded, e.g.: .git, *.dll, *.png, ..."

if args.Length > 3 then
Console.Error.WriteLine errTooManyArgs
Console.WriteLine note
Environment.Exit 1
elif args.Length < 2 then
Console.Error.WriteLine
"Need to pass two arguments: replace.fsx oldstring newstring"

Console.WriteLine note
Environment.Exit 1

let firstArg = args.[0]

let particularFile =
if firstArg.StartsWith "--file=" || firstArg.StartsWith "-f=" then
let file = firstArg.Substring(firstArg.IndexOf("=") + 1) |> FileInfo

if not file.Exists then
failwithf "File '%s' doesn't exist" file.FullName

Some file
else
if args.Length = 3 then
Console.Error.WriteLine errTooManyArgs
Console.WriteLine note
Environment.Exit 1
failwith "Unreachable"

None

match particularFile with
| None ->
let startDir = DirectoryInfo(Directory.GetCurrentDirectory())
let oldString, newString = args.[0], args.[1]
Misc.ReplaceTextInDir startDir oldString newString
| Some file ->
let oldString, newString = args.[1], args.[2]
Misc.ReplaceTextInFile file oldString newString
2 changes: 1 addition & 1 deletion scripts/runFSharpLint.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
open System.IO
open System.Linq

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk

Expand Down
2 changes: 1 addition & 1 deletion scripts/wrapLatestCommitMsg.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ open System.Linq

#load "../src/FileConventions/Library.fs"

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S dotnet fsi

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S dotnet fsi

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"

open Fsdk
open Fsdk.Process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
open System.IO
open System

#r "nuget: Fsdk, Version=0.6.0--date20230214-0422.git-1ea6f62"
#r "nuget: Fsdk, Version=0.6.1--date20260403-0728.git-c9a0eae"
2 changes: 1 addition & 1 deletion src/FileConventions.Test/FileConventions.Test.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Fsdk" Version="0.6.0--date20230214-0422.git-1ea6f62" />
<PackageReference Include="Fsdk" Version="0.6.1--date20260403-0728.git-c9a0eae" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading