1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-30 14:32:08 -05:00

Move fish exec to its own lib file

This commit is contained in:
Jack Foltz 2018-12-09 11:27:18 -05:00
parent be74f6439c
commit bc089d523e
Signed by: foltik
GPG Key ID: D1F0331758D1F29A
2 changed files with 11 additions and 6 deletions

View File

@ -1,15 +1,13 @@
import os
import distutils.dir_util import distutils.dir_util
import distutils.file_util import distutils.file_util
import subprocess
from pathlib import Path
from lib.diff import diff
from lib.package import Package from lib.package import Package
from lib.path import local_path, deploy_path from lib.path import local_path, deploy_path
import lib.proc as proc import lib.proc as proc
import lib.pacman as pacman import lib.pacman as pacman
import lib.yay as yay import lib.yay as yay
import lib.git as git import lib.git as git
from lib.diff import diff
from lib.fish import fish
installed_packages = pacman.get_installed() installed_packages = pacman.get_installed()
@ -63,12 +61,13 @@ def diff_config(package):
for config in package.config: for config in package.config:
print(diff(config, deploy_path(config))) print(diff(config, deploy_path(config)))
def run_script(package): def run_script(package):
if not package.run_script or not package.script: if not package.run_script or not package.script:
return return
for script in package.script: for script in package.script:
print('fish', script) print('fish', script)
proc.exec(['fish', package.script]) print(fish(script))
def export_units(package): def export_units(package):

6
lib/fish.py Normal file
View File

@ -0,0 +1,6 @@
import lib.proc as proc
def fish(path):
cmd = ['fish', str(path.expanduser())]
subproc = proc.exec(cmd)
return proc.communicate(subproc, cmd)