-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the original dune command with a project management script
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
let install () = | ||
[ "sudo rm -rf /usr/include/mlisp" | ||
; "sudo mkdir /usr/include/mlisp" | ||
; "sudo cp ./stdlib.mlisp /usr/include/mlisp" | ||
; "dune build --profile release" | ||
; "dune install" | ||
] | ||
|> List.iter (fun command -> Sys.command command |> ignore) | ||
;; | ||
|
||
let uninstall () = | ||
[ "sudo rm -rf /usr/include/mlisp"; "dune uninstall" ] | ||
|> List.iter (fun command -> Sys.command command |> ignore) | ||
;; | ||
|
||
let build () = | ||
[ "dune build --profile release" ] | ||
|> List.iter (fun command -> Sys.command command |> ignore) | ||
;; | ||
|
||
let test () = [ "dune test" ] |> List.iter (fun command -> Sys.command command |> ignore) | ||
|
||
let clean () = | ||
[ "dune clean" ] |> List.iter (fun command -> Sys.command command |> ignore) | ||
;; | ||
|
||
let repl () = | ||
[ "dune exec mlisp" ] |> List.iter (fun command -> Sys.command command |> ignore) | ||
;; | ||
|
||
let _ = | ||
match Sys.argv |> Array.to_list with | ||
| _ :: "install" :: _ -> install () | ||
| _ :: "uninstall" :: _ -> uninstall () | ||
| _ :: "build" :: _ -> build () | ||
| _ :: "test" :: _ -> test () | ||
| _ :: "clean" :: _ -> clean () | ||
| _ :: "repl" :: _ -> repl () | ||
| _ -> print_endline "Unknow option" | ||
;; |