some things for the install skript
This commit is contained in:
@@ -1,29 +1,26 @@
|
|||||||
#! /usr/bin/env python3
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
"""Naval Fate.
|
import os
|
||||||
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
from docopt import docopt
|
||||||
|
from subprocess import check_call
|
||||||
|
|
||||||
|
HELPTEXT = """{progname}.
|
||||||
|
|
||||||
|
Installs symlinks, plugins, plugin managers, ...
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
{progname} ship new <name>...
|
{progname} [-f] [-p <dir>] install all
|
||||||
{progname} ship <name> move <x> <y> [--speed=<kn>]
|
{progname} [-f] [-p <dir>] install vim
|
||||||
{progname} ship shoot <x> <y>
|
|
||||||
{progname} mine (set|remove) <x> <y> [--moored | --drifting]
|
|
||||||
{progname} (-h | --help)
|
{progname} (-h | --help)
|
||||||
{progname} --version
|
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h --help Show this screen.
|
-h --help Show this screen.
|
||||||
--version Show version.
|
-f --force Force install if files look already installed
|
||||||
--speed=<kn> Speed in knots [default: 10].
|
-p --path=<dir> Path to the dotfiles repo [default: .]
|
||||||
--moored Moored (anchored) mine.
|
|
||||||
--drifting Drifting mine.
|
|
||||||
|
|
||||||
""".format(progname="install_files")
|
""".format(progname="install_files")
|
||||||
import docopt
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
from subprocess import check_call
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
|
|
||||||
def install_vim(pdotfiles, force=False):
|
def install_vim(pdotfiles, force=False):
|
||||||
@@ -60,5 +57,7 @@ def install_vim(pdotfiles, force=False):
|
|||||||
pvundle.as_posix()])
|
pvundle.as_posix()])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
arguments = docopt(__doc__, version='0.1')
|
args = docopt(HELPTEXT, version='0.1')
|
||||||
print(arguments)
|
if args["install"]:
|
||||||
|
if any((args["all"], args["vim"])):
|
||||||
|
install_vim(Path(args["--path"]).resolve(), args["--force"])
|
||||||
|
|||||||
Reference in New Issue
Block a user