From 8c9a66632cc6512d30f33ed984a1acc7709d1c03 Mon Sep 17 00:00:00 2001 From: Nicole O'Connor Date: Fri, 30 Jun 2023 17:34:46 -0700 Subject: [PATCH] cellar create will now create ~/.local/share/cellar if it does not already exist --- src/bottles/create.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bottles/create.cpp b/src/bottles/create.cpp index f17e5c3..dac1941 100644 --- a/src/bottles/create.cpp +++ b/src/bottles/create.cpp @@ -30,8 +30,10 @@ void cellar::bottles::create_bottle(int argc, vector argv) { cmdparse.parse(argv); - + // sanity check: make sure ~/.local/share/cellar/bottles exists string homepath = getenv("HOME"); + if (!boost::filesystem::exists(homepath + "/.local/share/cellar/bottles")) { boost::filesystem::create_directories(homepath + "/.local/share/cellar/bottles"); } + string bottlechoice = bottlearg.getValue(); string fullbottlepath; if (bottlechoice.substr(0,1) == "/" || bottlechoice.substr(0,1) == ".") { // absolute or relative path