From fa731102ff9a266266137ee8fbc89ed64bb02c00 Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Sat, 8 Apr 2017 23:12:45 -0700 Subject: [PATCH] cellar remove no longer supports paths. what is this, rm --- src/bottles/remove.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/bottles/remove.cpp b/src/bottles/remove.cpp index 86787ca..5989348 100644 --- a/src/bottles/remove.cpp +++ b/src/bottles/remove.cpp @@ -17,16 +17,9 @@ void cellar::bottles::remove_bottle(int argc, vector 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");