An easy way to get rid of *everything* generated by SBT?

后端 未结 4 1413
情话喂你
情话喂你 2020-12-07 17:10

Is there an easy way to get rid of everything getting generated as a result of performing an SBT build? It turns out it creates target directories all over the place. Perfor

4条回答
  •  悲&欢浪女
    2020-12-07 18:09

    On Linux or similar, this is better than find -name, as it won't accidentally remove any directory named target that might exist in your source code:

    find . -regextype posix-awk -regex \.(/project)*/target -exec rm -r {} +
    

    If you're running this command within a shell, you'll need to quote the regular expression, for example, for bash:

    find . -regextype posix-awk -regex '\.(/project)*/target' -exec rm -r {} +
    

    With BSD find (e.g. on Mac OS X) the command will be:

    find -E . -regex \.(/project)*/target -exec rm -r {} +
    

提交回复
热议问题