fix install

This commit is contained in:
Jake Howard 2016-05-19 19:56:15 +01:00
parent 44eb3bbe7d
commit 595f2d0d1a

View file

@ -1,15 +1,12 @@
import click import click
from sh import sudo
import os import os
from yubi_lock.api import BASE_DIR
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
@click.command('install', short_help='Install required files for insertion detection') @click.command('install', short_help='Install required files for insertion detection')
@click.option('-v', '--verbose') def cli():
def cli(verbose): exit_code = os.system("sudo cp {} {}".format(BASE_DIR + "../data/85-yubikey-screen-lock.rules", "/etc/udev/rules.d/85-yubikey-screen-lock.rules"))
if verbose: if exit_code == 0:
print("Exporting UDEV rule...") print('Export complete!')
sudo.cp(BASE_DIR + "../data/85-yubikey-screen-lock.rules", "/etc/udev/rules.d/85-yubikey-screen-lock.rules") else:
print('Export complete!') print('Something went wrong!')