Clear binaries from removed containers

This commit is contained in:
Rudra Saraswat 2023-04-17 16:48:56 +05:30
parent f7cc861115
commit 5756f61ec1

View file

@ -4,8 +4,8 @@ import os
import sys import sys
import yaml import yaml
import time import time
import glob
import getpass import getpass
import shutil
import fileinput import fileinput
import subprocess import subprocess
@ -105,8 +105,6 @@ def create_container_binaries():
for c, i in _binaries: for c, i in _binaries:
try: try:
if i == 'apt':
print(c, i)
os.symlink(os.path.expanduser( os.symlink(os.path.expanduser(
f'~/.local/bin/blend_{c}/{i}'), os.path.expanduser(f'~/.local/bin/blend_bin/{i}')) f'~/.local/bin/blend_{c}/{i}'), os.path.expanduser(f'~/.local/bin/blend_bin/{i}'))
except FileExistsError: except FileExistsError:
@ -126,6 +124,10 @@ def create_container_binaries():
os.remove(os.path.join(os.path.expanduser( os.remove(os.path.join(os.path.expanduser(
f'~/.local/bin/blend_bin'), b)) 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(): def create_container_applications():
_apps = [] _apps = []