Skip to content

Commit

Permalink
don't remove if it does not exist
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
pablopunk and coderabbitai[bot] authored Dec 7, 2024
1 parent 50c8995 commit aba015b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,15 @@ local function remove_last_profile()
if not is_dir(".git") then
file_path = ".dot"
end
os.remove(file_path)
if is_file(file_path) then
local success, err = os.remove(file_path)
if not success then
print_message("error", "Failed to remove profile: " .. err)
return false
end
return true
end
return true
end

-- Main function
Expand Down

0 comments on commit aba015b

Please sign in to comment.