From 5756f61ec169b4d42576ba43166ee30727c1ff1b Mon Sep 17 00:00:00 2001 From: Rudra Saraswat Date: Mon, 17 Apr 2023 16:48:56 +0530 Subject: [PATCH] Clear binaries from removed containers --- blend-files | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/blend-files b/blend-files index 08e7bf5..69e6298 100755 --- a/blend-files +++ b/blend-files @@ -4,8 +4,8 @@ import os import sys import yaml import time +import glob import getpass -import shutil import fileinput import subprocess @@ -105,8 +105,6 @@ def create_container_binaries(): for c, i in _binaries: try: - if i == 'apt': - print(c, i) os.symlink(os.path.expanduser( f'~/.local/bin/blend_{c}/{i}'), os.path.expanduser(f'~/.local/bin/blend_bin/{i}')) except FileExistsError: @@ -126,6 +124,10 @@ def create_container_binaries(): os.remove(os.path.join(os.path.expanduser( f'~/.local/bin/blend_bin'), b)) + for b_dir in glob.glob(os.path.expanduser(f'~/.local/bin/blend_*')): + if os.path.basename(b_dir) != 'blend_bin' and os.path.basename(b_dir)[6:] not in _list: + subprocess.call(['rm', '-rf', b_dir], shell=False) + def create_container_applications(): _apps = []