diff options
| author | Zach DeCook <zach.decook@bettercarpeople.com> | 2024-06-14 11:27:02 -0400 |
|---|---|---|
| committer | Zach DeCook <zach.decook@bettercarpeople.com> | 2024-06-14 11:27:02 -0400 |
| commit | 906901169301965ff050c415a505086325a9a795 (patch) | |
| tree | cc9366a1b72fd331b8224874360b6706416bf01e /.local | |
| parent | bc3c2177f11891b4d8d7532955b7bc021c6ce10a (diff) | |
| download | dotfiles-906901169301965ff050c415a505086325a9a795.tar.gz | |
mfi.py: Fix for multiple files
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/mfi.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/.local/bin/mfi.py b/.local/bin/mfi.py index 30fc3ce..41bdf7c 100755 --- a/.local/bin/mfi.py +++ b/.local/bin/mfi.py @@ -3,23 +3,21 @@ import sys import subprocess args = sys.argv[1:] -subs = [] -nums = [] +files = [] +nums = {} for arg in args: file = arg.split(':')[0] r = subprocess.run(['find', '.', '-name', file],stdout=subprocess.PIPE) - subs.append(r) + files += r.stdout.decode().strip().split('\n') if ':' in arg: - nums.append(arg.split(':')[1]) + nums[file] = arg.split(':')[1] else: - nums.append(0) + nums[file] = 0 -nums.reverse() args = ['micro'] -for sub in subs: - n = nums.pop() - files = r.stdout.decode().strip().split('\n') - for file in files: +for file in files: + n = nums[file.split('/')[-1]] args.append(file+":"+str(n)) - + +#print(args) subprocess.run(args) |
