Repository navigation
Expand file tree
/
Copy pathsmoke.sh
More file actions
executable file
·49 lines (39 loc) · 1.43 KB
/
Copy pathsmoke.sh
File metadata and controls
executable file
·49 lines (39 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CODEX_BIN="${CODEX_BIN:-codex}"
TMP_HOME="$(mktemp -d)"
trap 'rm -rf "${TMP_HOME}"' EXIT
CODEX_HOME="${TMP_HOME}" "${ROOT}/scripts/install.sh"
CODEX_HOME="${TMP_HOME}" "${ROOT}/scripts/install.sh"
python3 - "${TMP_HOME}/config.toml" <<'PY'
import tomllib
import sys
from pathlib import Path
config_path = Path(sys.argv[1])
text = config_path.read_text()
config = tomllib.loads(text)
assert config["features"]["plugins"] is True
assert config["plugins"]["codex-thread-cron@codex-thread-cron"]["enabled"] is True
assert config["marketplaces"]["codex-thread-cron"]["source_type"] == "local"
assert "features.plugins = true" in text
assert text.count('plugins."codex-thread-cron@codex-thread-cron".enabled = true') == 1
print("install smoke: ok")
PY
CODEX_HOME="${TMP_HOME}" "${ROOT}/scripts/uninstall.sh"
python3 - "${TMP_HOME}/config.toml" <<'PY'
import tomllib
import sys
from pathlib import Path
config_path = Path(sys.argv[1])
text = config_path.read_text()
config = tomllib.loads(text) if text.strip() else {}
assert "features.plugins = true" not in text
assert "codex-thread-cron@codex-thread-cron" not in text
assert "marketplaces.codex-thread-cron" not in text
assert config.get("features", {}) == {}
assert config.get("plugins", {}) == {}
assert config.get("marketplaces", {}) == {}
print("uninstall smoke: ok")
PY
printf 'smoke: ok (%s)\n' "${CODEX_BIN}"