Skip to content

Commit

Permalink
Replace the original dune command with a project management script
Browse files Browse the repository at this point in the history
  • Loading branch information
muqiuhan committed Jul 30, 2022
1 parent 1f36936 commit cfe079f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pom.ml
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"
;;

0 comments on commit cfe079f

Please sign in to comment.