scriptvault 0.1.5b0__tar.gz → 0.1.6b0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scriptvault-0.1.5b0/src/scriptvault.egg-info → scriptvault-0.1.6b0}/PKG-INFO +1 -1
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/pyproject.toml +1 -1
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/__init__.py +2 -2
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/vault.py +13 -2
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0/src/scriptvault.egg-info}/PKG-INFO +1 -1
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_add.py +1 -1
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/LICENSE +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/README.md +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/setup.cfg +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/__main__.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/cli.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/envfile.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/run.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/templates.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault/term.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault.egg-info/SOURCES.txt +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault.egg-info/dependency_links.txt +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault.egg-info/entry_points.txt +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault.egg-info/requires.txt +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/src/scriptvault.egg-info/top_level.txt +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_completion.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_edit.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_init.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_list.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_real.py +0 -0
- {scriptvault-0.1.5b0 → scriptvault-0.1.6b0}/tests/test_run.py +0 -0
|
@@ -8,7 +8,7 @@ from pathlib import Path
|
|
|
8
8
|
|
|
9
9
|
from .envfile import parse_env_file
|
|
10
10
|
|
|
11
|
-
NAME_RE = re.compile(r"^[a-z0-9][a-z0-9_
|
|
11
|
+
NAME_RE = re.compile(r"^[a-z0-9][a-z0-9_.-]*$")
|
|
12
12
|
|
|
13
13
|
DEFAULT_HIDDEN_DIR = ".sv"
|
|
14
14
|
ENV_HIDDEN_DIR_VAR = "SV_HIDDEN_DIR"
|
|
@@ -430,12 +430,23 @@ def load_vault(root: Path) -> Vault:
|
|
|
430
430
|
# File scripts override same-name inline scripts.
|
|
431
431
|
vault.scripts = dict(inline)
|
|
432
432
|
if vault.scripts_dir.is_dir():
|
|
433
|
-
for path in sorted(vault.scripts_dir.glob("
|
|
433
|
+
for path in sorted(vault.scripts_dir.glob("*")):
|
|
434
434
|
if path.name.startswith("."):
|
|
435
435
|
continue
|
|
436
436
|
name = path.stem
|
|
437
437
|
if not NAME_RE.match(name):
|
|
438
438
|
continue
|
|
439
|
+
# Skip non-files
|
|
440
|
+
if not path.is_file():
|
|
441
|
+
continue
|
|
442
|
+
# Skip files without shebang
|
|
443
|
+
try:
|
|
444
|
+
content = path.read_bytes()
|
|
445
|
+
if len(content) >= 2:
|
|
446
|
+
if content[:2] != b"#!":
|
|
447
|
+
continue # No shebang
|
|
448
|
+
except Exception:
|
|
449
|
+
continue
|
|
439
450
|
description = ""
|
|
440
451
|
if name in inline:
|
|
441
452
|
description = inline[name].description
|
|
@@ -93,7 +93,7 @@ def test_add_rejects_orchestration_name(project, capsys, monkeypatch):
|
|
|
93
93
|
assert "already exists" in capsys.readouterr().err
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
@pytest.mark.parametrize("name", ["Hello", "
|
|
96
|
+
@pytest.mark.parametrize("name", ["Hello", "sp ace", ""])
|
|
97
97
|
def test_add_invalid_name(project, capsys, monkeypatch, name):
|
|
98
98
|
init(project, monkeypatch)
|
|
99
99
|
capsys.readouterr()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|