1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162(*---------------------------------------------------------------------------
Copyright (c) 2020 The b0 programmers. All rights reserved.
Distributed under the ISC license, see terms at the end of the file.
---------------------------------------------------------------------------*)openB0_stdopenB0_std.Result.Syntaxletdeletecclean=Log.if_error~use:B00_cli.Exit.some_error@@letdel_dir=matchcleanwith|true->Some(B0_driver.Conf.b0_dirc)|false->None(* For now *)inmatchdel_dirwith|None->Log.app(funm->m"Nothing deleted for now!");OkB00_cli.Exit.ok|Somedel_dir->let*_existed=Os.Path.delete~recurse:truedel_dirinOkB00_cli.Exit.ok(* Command line interface *)openCmdlinerletdoc="Delete builds"letsdocs=Manpage.s_common_optionsletexits=B0_driver.Exit.infosletman_xrefs=[`Main;`Cmd"cache"]letman=[`SManpage.s_description;`P"The $(tname) command deletes the current variant and deployement \
builds and artefacts. The build cache is however kept intact.";`P"Use option $(b,--clean) option to get rid of the $(b,_b0) directory \
altogeter. This deletes all variants and deployments an most likely \
also gets rid of the build cache. See $(mname) $(b,cache) for finer \
control over build cache deletions.";B0_b0.Cli.man_see_manual;]letclean=letdoc="Delete the $(b,_b0) directory."inArg.(value&flag&info["c";"clean"]~doc)letcmd=Cmd.v(Cmd.info"delete"~doc~sdocs~exits~man~man_xrefs)Term.(constdelete$B0_driver.Cli.conf$clean)(*---------------------------------------------------------------------------
Copyright (c) 2020 The b0 programmers
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------------------------*)