fix: don't run non-executable scripts
This commit is contained in:
parent
f232c40b1e
commit
deadc2b02a
37
poetry.lock
generated
37
poetry.lock
generated
@ -110,6 +110,21 @@ mccabe = ">=0.6.0,<0.7.0"
|
|||||||
pycodestyle = ">=2.5.0,<2.6.0"
|
pycodestyle = ">=2.5.0,<2.6.0"
|
||||||
pyflakes = ">=2.1.0,<2.2.0"
|
pyflakes = ">=2.1.0,<2.2.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
category = "main"
|
||||||
|
description = "Read metadata from Python packages"
|
||||||
|
name = "importlib-metadata"
|
||||||
|
optional = false
|
||||||
|
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
|
||||||
|
version = "1.6.0"
|
||||||
|
|
||||||
|
[package.dependencies]
|
||||||
|
zipp = ">=0.5"
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
docs = ["sphinx", "rst.linker"]
|
||||||
|
testing = ["packaging", "importlib-resources"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
category = "main"
|
category = "main"
|
||||||
description = "Jinxed Terminal Library"
|
description = "Jinxed Terminal Library"
|
||||||
@ -303,8 +318,20 @@ optional = false
|
|||||||
python-versions = "*"
|
python-versions = "*"
|
||||||
version = "0.1.8"
|
version = "0.1.8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
category = "main"
|
||||||
|
description = "Backport of pathlib-compatible object wrapper for zip files"
|
||||||
|
name = "zipp"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.6"
|
||||||
|
version = "3.1.0"
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
|
||||||
|
testing = ["jaraco.itertools", "func-timeout"]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
content-hash = "fd95a1de8c202bcfdd879a6d4ad47206212f3afad7e823ba527938a5dfcaeadc"
|
content-hash = "ea66303a3dcb7b3b41a3a0e9d189c6d49b57d574ccc152fa83c9225a3ac3f845"
|
||||||
python-versions = "^3.8"
|
python-versions = "^3.8"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
@ -347,6 +374,10 @@ flake8 = [
|
|||||||
{file = "flake8-3.7.9-py2.py3-none-any.whl", hash = "sha256:49356e766643ad15072a789a20915d3c91dc89fd313ccd71802303fd67e4deca"},
|
{file = "flake8-3.7.9-py2.py3-none-any.whl", hash = "sha256:49356e766643ad15072a789a20915d3c91dc89fd313ccd71802303fd67e4deca"},
|
||||||
{file = "flake8-3.7.9.tar.gz", hash = "sha256:45681a117ecc81e870cbf1262835ae4af5e7a8b08e40b944a8a6e6b895914cfb"},
|
{file = "flake8-3.7.9.tar.gz", hash = "sha256:45681a117ecc81e870cbf1262835ae4af5e7a8b08e40b944a8a6e6b895914cfb"},
|
||||||
]
|
]
|
||||||
|
importlib-metadata = [
|
||||||
|
{file = "importlib_metadata-1.6.0-py2.py3-none-any.whl", hash = "sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f"},
|
||||||
|
{file = "importlib_metadata-1.6.0.tar.gz", hash = "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e"},
|
||||||
|
]
|
||||||
jinxed = [
|
jinxed = [
|
||||||
{file = "jinxed-1.0.0-py2.py3-none-any.whl", hash = "sha256:79ceb7097ba9d905000905173554092e81fe31aebb107b9566a15767dfdc3a82"},
|
{file = "jinxed-1.0.0-py2.py3-none-any.whl", hash = "sha256:79ceb7097ba9d905000905173554092e81fe31aebb107b9566a15767dfdc3a82"},
|
||||||
{file = "jinxed-1.0.0.tar.gz", hash = "sha256:094d0e1c92b8bcf324d1fb4dceaa82cb79e4524790caf524eca0499807a0fbd8"},
|
{file = "jinxed-1.0.0.tar.gz", hash = "sha256:094d0e1c92b8bcf324d1fb4dceaa82cb79e4524790caf524eca0499807a0fbd8"},
|
||||||
@ -479,3 +510,7 @@ wcwidth = [
|
|||||||
{file = "wcwidth-0.1.8-py2.py3-none-any.whl", hash = "sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603"},
|
{file = "wcwidth-0.1.8-py2.py3-none-any.whl", hash = "sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603"},
|
||||||
{file = "wcwidth-0.1.8.tar.gz", hash = "sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8"},
|
{file = "wcwidth-0.1.8.tar.gz", hash = "sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8"},
|
||||||
]
|
]
|
||||||
|
zipp = [
|
||||||
|
{file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"},
|
||||||
|
{file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"},
|
||||||
|
]
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
from importlib_metadata import version
|
||||||
|
|
||||||
|
__version__ = version(__package__)
|
@ -10,5 +10,9 @@ class Hooks():
|
|||||||
script_list = self.dirs.hooks_dirs["after"].iterdir()
|
script_list = self.dirs.hooks_dirs["after"].iterdir()
|
||||||
|
|
||||||
for script in script_list:
|
for script in script_list:
|
||||||
if script.is_file():
|
if not os.access(script, os.X_OK):
|
||||||
|
print("{} isn't an executable file".format(script))
|
||||||
|
elif script.is_file():
|
||||||
os.system(script)
|
os.system(script)
|
||||||
|
else:
|
||||||
|
print("Recursion is not implemented")
|
||||||
|
@ -10,6 +10,8 @@ from blessed import Terminal # type: ignore
|
|||||||
from pomme.timer import Timer
|
from pomme.timer import Timer
|
||||||
from pomme.hooks import Hooks
|
from pomme.hooks import Hooks
|
||||||
|
|
||||||
|
from pomme import __version__
|
||||||
|
|
||||||
file_path = os.path.dirname(__file__)
|
file_path = os.path.dirname(__file__)
|
||||||
config = toml.load(os.path.join(file_path, "config.toml"))
|
config = toml.load(os.path.join(file_path, "config.toml"))
|
||||||
|
|
||||||
@ -63,9 +65,16 @@ def print_time(s) -> None:
|
|||||||
s.enter(1, 1, print_time, (s,))
|
s.enter(1, 1, print_time, (s,))
|
||||||
|
|
||||||
|
|
||||||
@click.group()
|
@click.group(invoke_without_command=True)
|
||||||
def pomme() -> None:
|
@click.option('-v', '--version', is_flag=True)
|
||||||
""" main command """
|
def pomme(version) -> None:
|
||||||
|
""" Pomme timer management system """
|
||||||
|
context = click.get_current_context()
|
||||||
|
if version:
|
||||||
|
print("Pomme version {}".format(__version__))
|
||||||
|
return
|
||||||
|
elif not context.invoked_subcommand:
|
||||||
|
print(context.get_help())
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pomme"
|
name = "pomme"
|
||||||
version = "0.1.2"
|
version = "0.1.3-alpha.0"
|
||||||
description = "proof of concept for pomme timer"
|
description = "proof of concept for pomme timer"
|
||||||
authors = ["koalp <koalp@alpaga.dev>"]
|
authors = ["koalp <koalp@alpaga.dev>"]
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
@ -11,6 +11,7 @@ click = "^7.0"
|
|||||||
toml = "^0.10.0"
|
toml = "^0.10.0"
|
||||||
blessed = "^1.5"
|
blessed = "^1.5"
|
||||||
pyxdg = "^0.26"
|
pyxdg = "^0.26"
|
||||||
|
importlib_metadata = "^1.6.0"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
mypy = "^0.761"
|
mypy = "^0.761"
|
||||||
|
Loading…
Reference in New Issue
Block a user