Skip to content

Commit

Permalink
convert ps1 to sh
Browse files Browse the repository at this point in the history
  • Loading branch information
SchlenkR authored and SchlenkR committed Sep 26, 2024
1 parent a857080 commit af055d6
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
symbolCache.db
.paket/load
docs/index.md
output/

# User-specific files
*.suo
Expand Down
18 changes: 14 additions & 4 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

#r "nuget: Fake.Core.Process"
Expand Down Expand Up @@ -29,15 +28,26 @@ module Helper =
runTarget t

type Args() =
let strippedArgs =
fsi.CommandLineArgs
|> Array.skipWhile (fun x -> x <> __SOURCE_FILE__ )
|> Array.skip 1
|> Array.toList
let taskName,taskArgs =
match fsi.CommandLineArgs |> Array.toList with
| fsi :: taskName :: taskArgs -> taskName, taskArgs
match strippedArgs with
| taskName :: taskArgs -> taskName, taskArgs
| _ ->
let msg = $"Wrong args. Expected: fsi :: taskName :: taskArgs"
printfn "%s" msg
Environment.Exit -1
failwith msg
member _.IsTask(arg) = taskName = arg
do
printfn $"Task name: {taskName}"
printfn $"Task args: {taskArgs}"
member _.IsTask(arg) =
let res = taskName = arg
printfn $"Checking task '{arg}'... {res} (taskName: '{taskName}')"
res
member _.TaskArgs = taskArgs

let args = Args()
Expand Down
1 change: 0 additions & 1 deletion docu-watch.ps1

This file was deleted.

1 change: 1 addition & 0 deletions docu-watch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./docu.sh watch
39 changes: 0 additions & 39 deletions docu.ps1

This file was deleted.

38 changes: 38 additions & 0 deletions docu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

docuIndexYamlHeader="---
IMPORTANT: This file is generated by \`./docu.sh\`. Please don't edit it manually!
title: FsHttp Overview
index: 1
---
"
readmeContent=$(cat ./README.md)
echo "$docuIndexYamlHeader$readmeContent" > ./docs/index.md

if [ -d ./.fsdocs ]; then
rm -rf ./.fsdocs
fi

dotnet tool restore
dotnet build ./src/FsHttp/FsHttp.fsproj -c Release -f net6.0

# what a hack...
if [ -z "$1" ]; then
mode="build"
else
mode="watch"
fi

dotnet fsdocs \
$mode \
--clean \
--sourcefolder ./src \
--properties Configuration=Release TargetFramework=net6.0 \
--sourcerepo https://github.com/fsprojects/FsHttp/blob/master/src \
--parameters root /FsHttp/ \
--output ./.docsOutput \
--ignoreprojects Test.CSharp.csproj \
--strict

1 change: 0 additions & 1 deletion publish.ps1

This file was deleted.

1 change: 1 addition & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet fsi build.fsx publish
1 change: 0 additions & 1 deletion test.ps1

This file was deleted.

1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet fsi build.fsx test

0 comments on commit af055d6

Please sign in to comment.