cellar remove no longer supports paths. what is this, rm

This commit is contained in:
Nicholas O'Connor 2017-04-08 23:12:45 -07:00
parent 74997e7280
commit fa731102ff

View File

@ -17,16 +17,9 @@ void cellar::bottles::remove_bottle(int argc, vector<string> argv) {
string homepath = getenv("HOME");
string bottlechoice = argv[1];
string fullbottlepath;
if (bottlechoice.substr(0,1) == "/" || bottlechoice.substr(0,1) == ".") { // absolute or relative path
fullbottlepath = bottlechoice;
} else if (bottlechoice.substr(0,1) == "~") { // "absolute" path in home directory, not expanded by the shell for some reason (i've seen some shit)
// this is a naive replacement and will fail if the user tries something like ~nick/.wine
// i'm figuring at that point if you're doing that, you'll also recognize if your shell
// isn't actually expanding your path...
bottlechoice.replace(0,1,getenv("HOME"));
// or at least you'll think to use verbose mode to make sure it's loading the right directory
output::warning("your shell didn't expand your given path properly, doing a naive replacement", true);
fullbottlepath = bottlechoice;
if (bottlechoice.substr(0,1) == "/" || bottlechoice.substr(0,1) == "." || bottlechoice.substr(0,1) == "~") { // absolute or relative path
output::error("paths not accepted");
return 1;
} else {
if (bottlechoice.substr(0,6) == ".wine.") {
output::statement("tip: cellar can add the \".wine.\" prefix automatically");