1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-27 21:19:51 -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.file_util
import subprocess
from pathlib import Path
from lib.diff import diff
from lib.package import Package
from lib.path import local_path, deploy_path
import lib.proc as proc
import lib.pacman as pacman
import lib.yay as yay
import lib.git as git
from lib.diff import diff
from lib.fish import fish
installed_packages = pacman.get_installed()
@ -63,12 +61,13 @@ def diff_config(package):
for config in package.config:
print(diff(config, deploy_path(config)))
def run_script(package):
if not package.run_script or not package.script:
return
for script in package.script:
print('fish', script)
proc.exec(['fish', package.script])
print(fish(script))
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)