machineconfig 2.0__py3-none-any.whl → 2.2__py3-none-any.whl
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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/cluster/cloud_manager.py +0 -3
- machineconfig/cluster/data_transfer.py +0 -1
- machineconfig/cluster/file_manager.py +0 -1
- machineconfig/cluster/job_params.py +0 -3
- machineconfig/cluster/loader_runner.py +0 -3
- machineconfig/cluster/remote_machine.py +0 -1
- machineconfig/cluster/script_notify_upon_completion.py +0 -1
- machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +5 -6
- machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -1
- machineconfig/cluster/sessions_managers/enhanced_command_runner.py +17 -57
- machineconfig/cluster/sessions_managers/wt_local.py +36 -110
- machineconfig/cluster/sessions_managers/wt_local_manager.py +42 -112
- machineconfig/cluster/sessions_managers/wt_remote.py +23 -30
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +20 -62
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +10 -15
- machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +27 -127
- machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +10 -43
- machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +22 -101
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +11 -39
- machineconfig/cluster/sessions_managers/zellij_local.py +49 -102
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +34 -78
- machineconfig/cluster/sessions_managers/zellij_remote.py +17 -24
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +7 -13
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +4 -2
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +6 -6
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +18 -88
- machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +2 -6
- machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +12 -40
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +3 -2
- machineconfig/cluster/templates/cli_click.py +0 -1
- machineconfig/cluster/templates/cli_gooey.py +0 -2
- machineconfig/cluster/templates/cli_trogon.py +0 -1
- machineconfig/cluster/templates/run_cloud.py +0 -1
- machineconfig/cluster/templates/run_cluster.py +0 -1
- machineconfig/cluster/templates/run_remote.py +0 -1
- machineconfig/cluster/templates/utils.py +27 -46
- machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/linux/msc/cli_agents.sh +16 -0
- machineconfig/jobs/python/check_installations.py +2 -1
- machineconfig/jobs/python/create_bootable_media.py +0 -2
- machineconfig/jobs/python/python_ve_symlink.py +9 -11
- machineconfig/jobs/python/tasks.py +0 -1
- machineconfig/jobs/python/vscode/api.py +5 -5
- machineconfig/jobs/python/vscode/link_ve.py +13 -14
- machineconfig/jobs/python/vscode/select_interpreter.py +21 -22
- machineconfig/jobs/python/vscode/sync_code.py +9 -13
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +13 -13
- machineconfig/jobs/python_custom_installers/dev/aider.py +7 -15
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +9 -18
- machineconfig/jobs/python_custom_installers/dev/brave.py +10 -19
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +8 -15
- machineconfig/jobs/python_custom_installers/dev/code.py +12 -32
- machineconfig/jobs/python_custom_installers/dev/cursor.py +3 -14
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +8 -7
- machineconfig/jobs/python_custom_installers/dev/espanso.py +15 -19
- machineconfig/jobs/python_custom_installers/dev/goes.py +5 -12
- machineconfig/jobs/python_custom_installers/dev/lvim.py +9 -17
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +12 -19
- machineconfig/jobs/python_custom_installers/dev/redis.py +12 -20
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +12 -19
- machineconfig/jobs/python_custom_installers/dev/winget.py +5 -23
- machineconfig/jobs/python_custom_installers/docker.py +12 -21
- machineconfig/jobs/python_custom_installers/gh.py +11 -19
- machineconfig/jobs/python_custom_installers/hx.py +32 -16
- machineconfig/jobs/python_custom_installers/warp-cli.py +12 -20
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/python_generic_installers/config.json +1 -1
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -1
- machineconfig/jobs/windows/msc/cli_agents.bat +0 -0
- machineconfig/jobs/windows/msc/cli_agents.ps1 +0 -0
- machineconfig/jobs/windows/start_terminal.ps1 +1 -1
- machineconfig/profile/create.py +38 -26
- machineconfig/profile/create_hardlinks.py +29 -20
- machineconfig/profile/shell.py +56 -32
- machineconfig/scripts/__init__.py +0 -2
- machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/cloud/init.sh +2 -2
- machineconfig/scripts/linux/checkout_versions +1 -1
- machineconfig/scripts/linux/choose_wezterm_theme +1 -1
- machineconfig/scripts/linux/cloud_copy +1 -1
- machineconfig/scripts/linux/cloud_manager +1 -1
- machineconfig/scripts/linux/cloud_mount +1 -1
- machineconfig/scripts/linux/cloud_repo_sync +1 -1
- machineconfig/scripts/linux/cloud_sync +1 -1
- machineconfig/scripts/linux/croshell +1 -1
- machineconfig/scripts/linux/devops +7 -7
- machineconfig/scripts/linux/fire +1 -1
- machineconfig/scripts/linux/fire_agents +3 -2
- machineconfig/scripts/linux/ftpx +1 -1
- machineconfig/scripts/linux/gh_models +1 -1
- machineconfig/scripts/linux/kill_process +1 -1
- machineconfig/scripts/linux/mcinit +1 -1
- machineconfig/scripts/linux/repos +1 -1
- machineconfig/scripts/linux/scheduler +1 -1
- machineconfig/scripts/linux/start_slidev +1 -1
- machineconfig/scripts/linux/start_terminals +1 -1
- machineconfig/scripts/linux/url2md +1 -1
- machineconfig/scripts/linux/warp-cli.sh +122 -0
- machineconfig/scripts/linux/wifi_conn +1 -1
- machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-313.pyc +0 -0
- machineconfig/scripts/python/ai/__init__.py +0 -0
- machineconfig/scripts/python/ai/generate_files.py +83 -0
- machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +2 -2
- machineconfig/scripts/python/ai/mcinit.py +14 -7
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +10 -5
- machineconfig/scripts/python/archive/tmate_conn.py +5 -5
- machineconfig/scripts/python/archive/tmate_start.py +7 -7
- machineconfig/scripts/python/choose_wezterm_theme.py +35 -32
- machineconfig/scripts/python/cloud_copy.py +23 -14
- machineconfig/scripts/python/cloud_mount.py +36 -24
- machineconfig/scripts/python/cloud_repo_sync.py +40 -27
- machineconfig/scripts/python/cloud_sync.py +4 -4
- machineconfig/scripts/python/croshell.py +40 -29
- machineconfig/scripts/python/devops.py +45 -27
- machineconfig/scripts/python/devops_add_identity.py +15 -25
- machineconfig/scripts/python/devops_add_ssh_key.py +8 -8
- machineconfig/scripts/python/devops_backup_retrieve.py +18 -16
- machineconfig/scripts/python/devops_devapps_install.py +25 -20
- machineconfig/scripts/python/devops_update_repos.py +232 -59
- machineconfig/scripts/python/dotfile.py +17 -15
- machineconfig/scripts/python/fire_agents.py +48 -22
- machineconfig/scripts/python/fire_jobs.py +93 -58
- machineconfig/scripts/python/ftpx.py +26 -15
- machineconfig/scripts/python/get_zellij_cmd.py +8 -7
- machineconfig/scripts/python/helpers/cloud_helpers.py +33 -28
- machineconfig/scripts/python/helpers/helpers2.py +27 -16
- machineconfig/scripts/python/helpers/helpers4.py +45 -32
- machineconfig/scripts/python/helpers/helpers5.py +1 -1
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +32 -10
- machineconfig/scripts/python/mount_nfs.py +9 -16
- machineconfig/scripts/python/mount_nw_drive.py +10 -5
- machineconfig/scripts/python/mount_ssh.py +9 -7
- machineconfig/scripts/python/repos.py +216 -58
- machineconfig/scripts/python/snapshot.py +0 -1
- machineconfig/scripts/python/start_slidev.py +11 -6
- machineconfig/scripts/python/start_terminals.py +22 -16
- machineconfig/scripts/python/viewer_template.py +0 -1
- machineconfig/scripts/python/wifi_conn.py +49 -75
- machineconfig/scripts/python/wsl_windows_transfer.py +9 -7
- machineconfig/scripts/windows/checkout_version.ps1 +1 -3
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +1 -3
- machineconfig/scripts/windows/cloud_copy.ps1 +2 -6
- machineconfig/scripts/windows/cloud_manager.ps1 +1 -1
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +1 -2
- machineconfig/scripts/windows/cloud_sync.ps1 +2 -2
- machineconfig/scripts/windows/croshell.ps1 +2 -2
- machineconfig/scripts/windows/devops.ps1 +1 -4
- machineconfig/scripts/windows/dotfile.ps1 +1 -3
- machineconfig/scripts/windows/fire.ps1 +1 -1
- machineconfig/scripts/windows/ftpx.ps1 +2 -2
- machineconfig/scripts/windows/gpt.ps1 +1 -1
- machineconfig/scripts/windows/kill_process.ps1 +1 -2
- machineconfig/scripts/windows/mcinit.ps1 +1 -1
- machineconfig/scripts/windows/mount_nfs.ps1 +1 -1
- machineconfig/scripts/windows/mount_ssh.ps1 +1 -1
- machineconfig/scripts/windows/pomodoro.ps1 +1 -1
- machineconfig/scripts/windows/py2exe.ps1 +1 -3
- machineconfig/scripts/windows/repos.ps1 +1 -1
- machineconfig/scripts/windows/scheduler.ps1 +1 -1
- machineconfig/scripts/windows/snapshot.ps1 +2 -2
- machineconfig/scripts/windows/start_slidev.ps1 +1 -1
- machineconfig/scripts/windows/start_terminals.ps1 +1 -1
- machineconfig/scripts/windows/wifi_conn.ps1 +1 -1
- machineconfig/scripts/windows/wsl_windows_transfer.ps1 +1 -3
- machineconfig/settings/lf/linux/lfrc +2 -1
- machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
- machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
- machineconfig/settings/lvim/windows/archive/config_additional.lua +1 -1
- machineconfig/settings/svim/linux/init.toml +1 -1
- machineconfig/settings/svim/windows/init.toml +1 -1
- machineconfig/setup_linux/web_shortcuts/croshell.sh +3 -52
- machineconfig/setup_linux/web_shortcuts/interactive.sh +6 -6
- machineconfig/setup_linux/web_shortcuts/ssh.sh +0 -4
- machineconfig/setup_windows/web_shortcuts/all.ps1 +2 -2
- machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +1 -1
- machineconfig/setup_windows/web_shortcuts/croshell.ps1 +1 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +5 -5
- machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +51 -15
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +58 -13
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +45 -37
- machineconfig/utils/ai/generate_file_checklist.py +8 -10
- machineconfig/utils/ai/url2md.py +4 -2
- machineconfig/utils/cloud/onedrive/setup_oauth.py +1 -0
- machineconfig/utils/cloud/onedrive/transaction.py +63 -98
- machineconfig/utils/code.py +62 -41
- machineconfig/utils/installer.py +29 -35
- machineconfig/utils/installer_utils/installer_abc.py +11 -11
- machineconfig/utils/installer_utils/installer_class.py +155 -74
- machineconfig/utils/links.py +112 -31
- machineconfig/utils/notifications.py +211 -0
- machineconfig/utils/options.py +41 -42
- machineconfig/utils/path.py +13 -6
- machineconfig/utils/path_reduced.py +614 -311
- machineconfig/utils/procs.py +48 -42
- machineconfig/utils/scheduling.py +0 -1
- machineconfig/utils/source_of_truth.py +27 -0
- machineconfig/utils/ssh.py +146 -85
- machineconfig/utils/terminal.py +84 -37
- machineconfig/utils/upgrade_packages.py +91 -0
- machineconfig/utils/utils2.py +39 -50
- machineconfig/utils/utils5.py +195 -116
- machineconfig/utils/ve.py +13 -5
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/METADATA +14 -13
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/RECORD +212 -237
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
- machineconfig/jobs/python/archive/python_tools.txt +0 -12
- machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/update.py +0 -3
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/linux/activate_ve +0 -87
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/windows/activate_ve.ps1 +0 -54
- machineconfig/setup_linux/web_shortcuts/all.sh +0 -48
- machineconfig/setup_linux/web_shortcuts/update_system.sh +0 -48
- machineconfig/utils/utils.py +0 -95
- /machineconfig/setup_linux/web_shortcuts/{tmp.sh → android.sh} +0 -0
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/WHEEL +0 -0
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/top_level.txt +0 -0
|
@@ -1,37 +1,29 @@
|
|
|
1
|
-
"""wezterm installer
|
|
2
|
-
"""
|
|
1
|
+
"""wezterm installer"""
|
|
3
2
|
|
|
4
3
|
import platform
|
|
5
4
|
from typing import Optional
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
config_dict = {
|
|
9
|
-
"repo_url": "CUSTOM",
|
|
10
|
-
"doc": "cli for wezterm",
|
|
11
|
-
"filename_template_windows_amd_64": "",
|
|
12
|
-
"filename_template_linux_amd_64": "",
|
|
13
|
-
"strip_v": False,
|
|
14
|
-
"exe_name": "wezterm"
|
|
15
|
-
}
|
|
7
|
+
config_dict = {"repo_url": "CUSTOM", "doc": "cli for wezterm", "filename_template_windows_amd_64": "", "filename_template_linux_amd_64": "", "strip_v": False, "exe_name": "wezterm"}
|
|
16
8
|
|
|
17
9
|
|
|
18
10
|
def main(version: Optional[str]):
|
|
19
11
|
print(f"""
|
|
20
|
-
{
|
|
12
|
+
{"═" * 150}
|
|
21
13
|
🖥️ WEZTERM INSTALLER | Modern, GPU-accelerated terminal emulator
|
|
22
14
|
💻 Platform: {platform.system()}
|
|
23
|
-
🔄 Version: {
|
|
24
|
-
{
|
|
15
|
+
🔄 Version: {"latest" if version is None else version}
|
|
16
|
+
{"═" * 150}
|
|
25
17
|
""")
|
|
26
18
|
|
|
27
19
|
_ = version
|
|
28
20
|
if platform.system() == "Windows":
|
|
29
21
|
error_msg = "WezTerm installation not supported on Windows through this installer"
|
|
30
22
|
print(f"""
|
|
31
|
-
{
|
|
23
|
+
{"⚠️" * 20}
|
|
32
24
|
❌ ERROR | {error_msg}
|
|
33
25
|
💡 TIP: Please download and install manually from the WezTerm website
|
|
34
|
-
{
|
|
26
|
+
{"⚠️" * 20}
|
|
35
27
|
""")
|
|
36
28
|
raise NotImplementedError(error_msg)
|
|
37
29
|
elif platform.system() in ["Linux", "Darwin"]:
|
|
@@ -41,6 +33,7 @@ def main(version: Optional[str]):
|
|
|
41
33
|
""")
|
|
42
34
|
import machineconfig.jobs.python_custom_installers as module
|
|
43
35
|
from pathlib import Path
|
|
36
|
+
|
|
44
37
|
if platform.system() == "Linux":
|
|
45
38
|
program = Path(module.__file__).parent.joinpath("scripts/linux/wezterm.sh").read_text(encoding="utf-8")
|
|
46
39
|
else: # Darwin/macOS
|
|
@@ -48,14 +41,14 @@ def main(version: Optional[str]):
|
|
|
48
41
|
else:
|
|
49
42
|
error_msg = f"Unsupported platform: {platform.system()}"
|
|
50
43
|
print(f"""
|
|
51
|
-
{
|
|
44
|
+
{"⚠️" * 20}
|
|
52
45
|
❌ ERROR | {error_msg}
|
|
53
|
-
{
|
|
46
|
+
{"⚠️" * 20}
|
|
54
47
|
""")
|
|
55
48
|
raise NotImplementedError(error_msg)
|
|
56
49
|
|
|
57
50
|
print(f"""
|
|
58
|
-
{
|
|
51
|
+
{"═" * 150}
|
|
59
52
|
ℹ️ INFO | WezTerm Features:
|
|
60
53
|
⚡ GPU-accelerated rendering
|
|
61
54
|
🎨 Full color emoji support
|
|
@@ -63,7 +56,7 @@ def main(version: Optional[str]):
|
|
|
63
56
|
⚙️ Lua configuration
|
|
64
57
|
📦 Cross-platform support
|
|
65
58
|
🔌 Plugin system
|
|
66
|
-
{
|
|
59
|
+
{"═" * 150}
|
|
67
60
|
""")
|
|
68
61
|
|
|
69
62
|
# _res = Terminal(stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).run_script(script=program, shell="default").print(desc="Running custom installer", capture=True)
|
|
@@ -5,14 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
config_dict = {
|
|
9
|
-
"repo_url": "CUSTOM",
|
|
10
|
-
"doc": "winget installer",
|
|
11
|
-
"filename_template_windows_amd_64": "",
|
|
12
|
-
"filename_template_linux_amd_64": "",
|
|
13
|
-
"strip_v": False,
|
|
14
|
-
"exe_name": "winget"
|
|
15
|
-
}
|
|
8
|
+
config_dict = {"repo_url": "CUSTOM", "doc": "winget installer", "filename_template_windows_amd_64": "", "filename_template_linux_amd_64": "", "strip_v": False, "exe_name": "winget"}
|
|
16
9
|
|
|
17
10
|
|
|
18
11
|
def is_winget_available() -> bool:
|
|
@@ -23,12 +16,7 @@ def is_winget_available() -> bool:
|
|
|
23
16
|
bool: True if winget is available, False otherwise
|
|
24
17
|
"""
|
|
25
18
|
try:
|
|
26
|
-
result = subprocess.run(
|
|
27
|
-
["winget", "--version"],
|
|
28
|
-
capture_output=True,
|
|
29
|
-
text=True,
|
|
30
|
-
timeout=10
|
|
31
|
-
)
|
|
19
|
+
result = subprocess.run(["winget", "--version"], capture_output=True, text=True, timeout=10)
|
|
32
20
|
return result.returncode == 0
|
|
33
21
|
except (subprocess.TimeoutExpired, FileNotFoundError, subprocess.SubprocessError):
|
|
34
22
|
return False
|
|
@@ -77,7 +65,7 @@ def download_file(url: str, destination: Path) -> bool:
|
|
|
77
65
|
response = requests.get(url, stream=True, timeout=60)
|
|
78
66
|
response.raise_for_status()
|
|
79
67
|
|
|
80
|
-
with open(destination,
|
|
68
|
+
with open(destination, "wb") as f:
|
|
81
69
|
for chunk in response.iter_content(chunk_size=8192):
|
|
82
70
|
if chunk:
|
|
83
71
|
f.write(chunk)
|
|
@@ -100,18 +88,13 @@ def install_msix_package(package_path: Path) -> bool:
|
|
|
100
88
|
"""
|
|
101
89
|
try:
|
|
102
90
|
# Use PowerShell to install the MSIX package
|
|
103
|
-
powershell_cmd = [
|
|
104
|
-
"powershell.exe",
|
|
105
|
-
"-ExecutionPolicy", "Bypass",
|
|
106
|
-
"-Command",
|
|
107
|
-
f"Add-AppxPackage -Path '{package_path}'"
|
|
108
|
-
]
|
|
91
|
+
powershell_cmd = ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command", f"Add-AppxPackage -Path '{package_path}'"]
|
|
109
92
|
|
|
110
93
|
result = subprocess.run(
|
|
111
94
|
powershell_cmd,
|
|
112
95
|
capture_output=True,
|
|
113
96
|
text=True,
|
|
114
|
-
timeout=300 # 5 minutes timeout
|
|
97
|
+
timeout=300, # 5 minutes timeout
|
|
115
98
|
)
|
|
116
99
|
|
|
117
100
|
if result.returncode == 0:
|
|
@@ -191,4 +174,3 @@ if __name__ == "__main__":
|
|
|
191
174
|
print("Winget is ready to use!")
|
|
192
175
|
else:
|
|
193
176
|
print("Failed to ensure winget availability.")
|
|
194
|
-
|
|
@@ -1,38 +1,29 @@
|
|
|
1
|
-
"""docker installer
|
|
2
|
-
"""
|
|
1
|
+
"""docker installer"""
|
|
3
2
|
|
|
4
3
|
import platform
|
|
5
4
|
from typing import Optional
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
config_dict = {
|
|
9
|
-
"repo_url": "CUSTOM",
|
|
10
|
-
"doc": "lightweight containerization",
|
|
11
|
-
"filename_template_windows_amd_64": "",
|
|
12
|
-
"filename_template_linux_amd_64": "",
|
|
13
|
-
"strip_v": False,
|
|
14
|
-
"exe_name": "docker"
|
|
15
|
-
}
|
|
16
|
-
|
|
7
|
+
config_dict = {"repo_url": "CUSTOM", "doc": "lightweight containerization", "filename_template_windows_amd_64": "", "filename_template_linux_amd_64": "", "strip_v": False, "exe_name": "docker"}
|
|
17
8
|
|
|
18
9
|
|
|
19
10
|
def main(version: Optional[str]):
|
|
20
11
|
print(f"""
|
|
21
|
-
{
|
|
12
|
+
{"=" * 150}
|
|
22
13
|
🐳 DOCKER INSTALLER | Setting up containerization platform
|
|
23
14
|
💻 Platform: {platform.system()}
|
|
24
|
-
🔄 Version: {
|
|
25
|
-
{
|
|
15
|
+
🔄 Version: {"latest" if version is None else version}
|
|
16
|
+
{"=" * 150}
|
|
26
17
|
""")
|
|
27
18
|
|
|
28
19
|
_ = version
|
|
29
20
|
if platform.system() == "Windows":
|
|
30
21
|
error_msg = "Docker installation not supported on Windows through this installer"
|
|
31
22
|
print(f"""
|
|
32
|
-
{
|
|
23
|
+
{"⚠️" * 20}
|
|
33
24
|
❌ ERROR | {error_msg}
|
|
34
25
|
💡 TIP: Please use Docker Desktop for Windows instead
|
|
35
|
-
{
|
|
26
|
+
{"⚠️" * 20}
|
|
36
27
|
""")
|
|
37
28
|
raise NotImplementedError(error_msg)
|
|
38
29
|
elif platform.system() in ["Linux", "Darwin"]:
|
|
@@ -40,6 +31,7 @@ def main(version: Optional[str]):
|
|
|
40
31
|
print(f"🐧 Installing Docker on {system_name} using official script...")
|
|
41
32
|
import machineconfig.jobs.python_custom_installers as module
|
|
42
33
|
from pathlib import Path
|
|
34
|
+
|
|
43
35
|
if platform.system() == "Linux":
|
|
44
36
|
program = Path(module.__file__).parent.joinpath("scripts/linux/docker.sh").read_text(encoding="utf-8")
|
|
45
37
|
else: # Darwin/macOS
|
|
@@ -48,21 +40,21 @@ def main(version: Optional[str]):
|
|
|
48
40
|
else:
|
|
49
41
|
error_msg = f"Unsupported platform: {platform.system()}"
|
|
50
42
|
print(f"""
|
|
51
|
-
{
|
|
43
|
+
{"⚠️" * 20}
|
|
52
44
|
❌ ERROR | {error_msg}
|
|
53
|
-
{
|
|
45
|
+
{"⚠️" * 20}
|
|
54
46
|
""")
|
|
55
47
|
raise NotImplementedError(error_msg)
|
|
56
48
|
|
|
57
49
|
print(f"""
|
|
58
|
-
{
|
|
50
|
+
{"=" * 150}
|
|
59
51
|
ℹ️ INFO | Docker features:
|
|
60
52
|
📦 Container-based virtualization
|
|
61
53
|
🚀 Simplified application deployment
|
|
62
54
|
🔄 Consistent development environments
|
|
63
55
|
🛡️ Isolated application environments
|
|
64
56
|
📊 Efficient resource utilization
|
|
65
|
-
{
|
|
57
|
+
{"=" * 150}
|
|
66
58
|
""")
|
|
67
59
|
|
|
68
60
|
# _res = Terminal(stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).run_script(script=program, shell="default").print(desc="Running custom installer", capture=True)
|
|
@@ -72,4 +64,3 @@ def main(version: Optional[str]):
|
|
|
72
64
|
|
|
73
65
|
if __name__ == "__main__":
|
|
74
66
|
pass
|
|
75
|
-
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""gh-cli installer
|
|
2
|
-
"""
|
|
1
|
+
"""gh-cli installer"""
|
|
3
2
|
|
|
4
3
|
import platform
|
|
5
4
|
from typing import Optional
|
|
@@ -18,23 +17,16 @@ https://github.com/cli/cli
|
|
|
18
17
|
|
|
19
18
|
"""
|
|
20
19
|
|
|
21
|
-
config_dict = {
|
|
22
|
-
"repo_url": "https://github.com/cli/cli",
|
|
23
|
-
"doc": "GitHub CLI",
|
|
24
|
-
"filename_template_windows_amd_64": "gh_{}_windows_amd64.zip",
|
|
25
|
-
"filename_template_linux_amd_64": "gh_{}_linux_amd64.tar.gz",
|
|
26
|
-
"strip_v": True,
|
|
27
|
-
"exe_name": "gh"
|
|
28
|
-
}
|
|
20
|
+
config_dict = {"repo_url": "https://github.com/cli/cli", "doc": "GitHub CLI", "filename_template_windows_amd_64": "gh_{}_windows_amd64.zip", "filename_template_linux_amd_64": "gh_{}_linux_amd64.tar.gz", "strip_v": True, "exe_name": "gh"}
|
|
29
21
|
|
|
30
22
|
|
|
31
23
|
def main(version: Optional[str]):
|
|
32
24
|
print(f"""
|
|
33
|
-
{
|
|
25
|
+
{"═" * 150}
|
|
34
26
|
🔱 GITHUB CLI INSTALLER | Command line tool for GitHub
|
|
35
27
|
💻 Platform: {platform.system()}
|
|
36
|
-
🔄 Version: {
|
|
37
|
-
{
|
|
28
|
+
🔄 Version: {"latest" if version is None else version}
|
|
29
|
+
{"═" * 150}
|
|
38
30
|
""")
|
|
39
31
|
|
|
40
32
|
_ = version
|
|
@@ -45,9 +37,9 @@ def main(version: Optional[str]):
|
|
|
45
37
|
inst.install(version=version)
|
|
46
38
|
|
|
47
39
|
print(f"""
|
|
48
|
-
{
|
|
40
|
+
{"─" * 150}
|
|
49
41
|
🤖 GITHUB COPILOT | Setting up GitHub Copilot CLI extension
|
|
50
|
-
{
|
|
42
|
+
{"─" * 150}
|
|
51
43
|
""")
|
|
52
44
|
|
|
53
45
|
if platform.system() == "Windows":
|
|
@@ -66,9 +58,9 @@ gh extension install github/gh-copilot
|
|
|
66
58
|
else:
|
|
67
59
|
error_msg = f"Unsupported platform: {platform.system()}"
|
|
68
60
|
print(f"""
|
|
69
|
-
{
|
|
61
|
+
{"⚠️" * 20}
|
|
70
62
|
❌ ERROR | {error_msg}
|
|
71
|
-
{
|
|
63
|
+
{"⚠️" * 20}
|
|
72
64
|
""")
|
|
73
65
|
raise NotImplementedError(error_msg)
|
|
74
66
|
|
|
@@ -82,11 +74,11 @@ gh auth login --with-token $HOME/dotfiles/creds/git/gh_token.txt
|
|
|
82
74
|
Terminal().run(program, shell="default").print(desc="Installing GitHub Copilot extension", capture=True)
|
|
83
75
|
|
|
84
76
|
print(f"""
|
|
85
|
-
{
|
|
77
|
+
{"═" * 150}
|
|
86
78
|
✅ SUCCESS | GitHub CLI installation completed
|
|
87
79
|
🚀 GitHub Copilot CLI extension installed
|
|
88
80
|
🔑 Authentication configured with token
|
|
89
|
-
{
|
|
81
|
+
{"═" * 150}
|
|
90
82
|
""")
|
|
91
83
|
|
|
92
84
|
return program
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Installers do not add runtime files to the machine, hence this script.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from machineconfig.utils.path_reduced import
|
|
5
|
+
from machineconfig.utils.path_reduced import PathExtended as PathExtended
|
|
6
6
|
from machineconfig.utils.installer_utils.installer_abc import WINDOWS_INSTALL_PATH
|
|
7
7
|
from typing import Optional
|
|
8
8
|
import platform
|
|
@@ -14,13 +14,13 @@ from rich.panel import Panel
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
config_dict = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
"repo_url": "CUSTOM",
|
|
18
|
+
"doc": "Helix is a post-modern modal text editor.",
|
|
19
|
+
"filename_template_windows_amd_64": "helix-{}-x86_64-windows.zip",
|
|
20
|
+
"filename_template_linux_amd_64": "helix-{}-x86_64-linux.tar.xz",
|
|
21
|
+
"strip_v": False,
|
|
22
|
+
"exe_name": "hx",
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def main(version: Optional[str], install_lib: bool = False):
|
|
@@ -59,7 +59,6 @@ def main(version: Optional[str], install_lib: bool = False):
|
|
|
59
59
|
raise FileNotFoundError(f"'contrib' directory not found at expected location: {contrib}")
|
|
60
60
|
print(" ✨ Executable and components located.")
|
|
61
61
|
|
|
62
|
-
|
|
63
62
|
print("\n🗑️ [Step 3/5] Cleaning up previous installation (if any)...")
|
|
64
63
|
runtime_path = PathExtended.home().joinpath(".config/helix/runtime")
|
|
65
64
|
contrib_path = PathExtended.home().joinpath(".config/helix/contrib")
|
|
@@ -67,7 +66,6 @@ def main(version: Optional[str], install_lib: bool = False):
|
|
|
67
66
|
contrib_path.delete(sure=True, verbose=False)
|
|
68
67
|
print(f" ✨ Cleaned '{runtime_path}' and '{contrib_path}'.")
|
|
69
68
|
|
|
70
|
-
|
|
71
69
|
print("\n📦 [Step 4/5] Installing Helix components...")
|
|
72
70
|
target_config_dir = PathExtended("~/.config/helix").expanduser()
|
|
73
71
|
target_config_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -80,10 +78,16 @@ def main(version: Optional[str], install_lib: bool = False):
|
|
|
80
78
|
contrib.move(folder=target_config_dir, overwrite=True)
|
|
81
79
|
runtime.move(folder=target_config_dir, overwrite=True)
|
|
82
80
|
system_name = "Linux" if platform.system() == "Linux" else "macOS"
|
|
83
|
-
console.print(
|
|
81
|
+
console.print(
|
|
82
|
+
Panel(
|
|
83
|
+
f"""✅ SUCCESS | Helix editor installed successfully on {system_name}!
|
|
84
84
|
|
|
85
85
|
📂 Executable: {target_bin_path / exe_name}
|
|
86
|
-
🔧 Config: {target_config_dir}""",
|
|
86
|
+
🔧 Config: {target_config_dir}""",
|
|
87
|
+
title="Success",
|
|
88
|
+
expand=False,
|
|
89
|
+
)
|
|
90
|
+
)
|
|
87
91
|
elif platform.system() == "Windows":
|
|
88
92
|
target_bin_path = PathExtended(WINDOWS_INSTALL_PATH)
|
|
89
93
|
exe_name = "hx.exe"
|
|
@@ -91,12 +95,24 @@ def main(version: Optional[str], install_lib: bool = False):
|
|
|
91
95
|
if install_lib:
|
|
92
96
|
contrib.move(folder=target_config_dir, overwrite=True)
|
|
93
97
|
runtime.move(folder=target_config_dir, overwrite=True)
|
|
94
|
-
console.print(
|
|
98
|
+
console.print(
|
|
99
|
+
Panel(
|
|
100
|
+
f"""✅ SUCCESS | Helix editor installed successfully on Windows!
|
|
95
101
|
📂 Executable: {target_bin_path / exe_name}
|
|
96
|
-
🔧 Config: {target_config_dir}""",
|
|
102
|
+
🔧 Config: {target_config_dir}""",
|
|
103
|
+
title="Success",
|
|
104
|
+
expand=False,
|
|
105
|
+
)
|
|
106
|
+
)
|
|
97
107
|
else:
|
|
98
|
-
console.print(
|
|
99
|
-
|
|
108
|
+
console.print(
|
|
109
|
+
Panel(
|
|
110
|
+
f"""⚠️ WARNING | Unsupported operating system: {platform.system()}
|
|
111
|
+
| Installation aborted.""",
|
|
112
|
+
title="Warning",
|
|
113
|
+
expand=False,
|
|
114
|
+
)
|
|
115
|
+
)
|
|
100
116
|
print("\n🧹 [Step 5/5] Cleaning up temporary download files...")
|
|
101
117
|
downloaded.delete(sure=True)
|
|
102
118
|
print(" ✨ Cleanup complete.")
|
|
@@ -1,37 +1,29 @@
|
|
|
1
|
-
"""warp-cli installer
|
|
2
|
-
"""
|
|
1
|
+
"""warp-cli installer"""
|
|
3
2
|
|
|
4
3
|
import platform
|
|
5
4
|
from typing import Optional
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
config_dict = {
|
|
9
|
-
"repo_url": "CUSTOM",
|
|
10
|
-
"doc": "cli for warp from cloudflare",
|
|
11
|
-
"filename_template_windows_amd_64": "",
|
|
12
|
-
"filename_template_linux_amd_64": "",
|
|
13
|
-
"strip_v": False,
|
|
14
|
-
"exe_name": "warp-cli"
|
|
15
|
-
}
|
|
7
|
+
config_dict = {"repo_url": "CUSTOM", "doc": "cli for warp from cloudflare", "filename_template_windows_amd_64": "", "filename_template_linux_amd_64": "", "strip_v": False, "exe_name": "warp-cli"}
|
|
16
8
|
|
|
17
9
|
|
|
18
10
|
def main(version: Optional[str]):
|
|
19
11
|
print(f"""
|
|
20
|
-
{
|
|
12
|
+
{"═" * 150}
|
|
21
13
|
🌐 CLOUDFLARE WARP | Installing Cloudflare WARP CLI
|
|
22
14
|
💻 Platform: {platform.system()}
|
|
23
|
-
🔄 Version: {
|
|
24
|
-
{
|
|
15
|
+
🔄 Version: {"latest" if version is None else version}
|
|
16
|
+
{"═" * 150}
|
|
25
17
|
""")
|
|
26
18
|
|
|
27
19
|
_ = version
|
|
28
20
|
if platform.system() == "Windows":
|
|
29
21
|
error_msg = "WARP CLI installation not supported on Windows through this installer"
|
|
30
22
|
print(f"""
|
|
31
|
-
{
|
|
23
|
+
{"⚠️" * 20}
|
|
32
24
|
❌ ERROR | {error_msg}
|
|
33
25
|
💡 TIP: Please download and install manually from Cloudflare website
|
|
34
|
-
{
|
|
26
|
+
{"⚠️" * 20}
|
|
35
27
|
""")
|
|
36
28
|
raise NotImplementedError(error_msg)
|
|
37
29
|
elif platform.system() in ["Linux", "Darwin"]:
|
|
@@ -40,25 +32,26 @@ def main(version: Optional[str]):
|
|
|
40
32
|
""")
|
|
41
33
|
import machineconfig.jobs.python_custom_installers as module
|
|
42
34
|
from pathlib import Path
|
|
35
|
+
|
|
43
36
|
program = Path(module.__file__).parent.joinpath("scripts/linux/warp-cli.sh").read_text(encoding="utf-8")
|
|
44
37
|
else:
|
|
45
38
|
error_msg = f"Unsupported platform: {platform.system()}"
|
|
46
39
|
print(f"""
|
|
47
|
-
{
|
|
40
|
+
{"⚠️" * 20}
|
|
48
41
|
❌ ERROR | {error_msg}
|
|
49
|
-
{
|
|
42
|
+
{"⚠️" * 20}
|
|
50
43
|
""")
|
|
51
44
|
raise NotImplementedError(error_msg)
|
|
52
45
|
|
|
53
46
|
print(f"""
|
|
54
|
-
{
|
|
47
|
+
{"═" * 150}
|
|
55
48
|
ℹ️ INFO | Cloudflare WARP Features:
|
|
56
49
|
🔒 Secure your internet connection
|
|
57
50
|
🚀 Improve browsing performance
|
|
58
51
|
🛡️ Hide your IP address
|
|
59
52
|
🔐 Encrypt your DNS queries
|
|
60
53
|
🌐 Access Cloudflare Zero Trust services
|
|
61
|
-
{
|
|
54
|
+
{"═" * 150}
|
|
62
55
|
""")
|
|
63
56
|
|
|
64
57
|
# _res = Terminal(stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).run_script(script=program, shell="default").print(desc="Running custom installer", capture=True)
|
|
@@ -68,4 +61,3 @@ def main(version: Optional[str]):
|
|
|
68
61
|
|
|
69
62
|
if __name__ == "__main__":
|
|
70
63
|
pass
|
|
71
|
-
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
"doc": "🚀 Fly through your shell history. Great Scott!",
|
|
220
220
|
"filename_template_linux_amd_64": "mcfly-v{}-x86_64-unknown-linux-musl.tar.gz",
|
|
221
221
|
"filename_template_linux_arm_64": "mcfly-v{}-aarch64-unknown-linux-musl.tar.gz",
|
|
222
|
-
"filename_template_windows_amd_64": "
|
|
222
|
+
"filename_template_windows_amd_64": "",
|
|
223
223
|
"filename_template_macos_amd_64": "mcfly-v{}-x86_64-apple-darwin.tar.gz",
|
|
224
224
|
"filename_template_macos_arm_64": "",
|
|
225
225
|
"filename_template_windows_arm_64": "",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# winget install Microsoft.VC++2015-2022Redist-x86
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
. "$env:USERPROFILE\code\machineconfig\.venv\Scripts\Activate.ps1"
|
|
9
9
|
Set-Location C:
|
|
10
10
|
python -m pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz\include" --global-option="-LC:\Program Files\Graphviz\lib" pygraphviz
|
|
11
11
|
# not including the options as above (from https://pygraphviz.github.io/documentation/stable/install.html)
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
wt --profile croshell -d . --title "MyTerminal" --tabColor "red"`; split-pane --vertical --size 0.55 pwsh machineconfig-workingdirectory ~/code/
|
|
2
|
+
wt --profile croshell -d . --title "MyTerminal" --tabColor "red"`; split-pane --vertical --size 0.55 pwsh machineconfig-workingdirectory ~/code/machineconfig -Command "pwd" `; split-pane -V PowerShell -NoExit -Command "cd code/machineconfig" `; split-pane -H wsl.exe cmatrix`; split-pane -V wsl.exe sl
|
|
3
3
|
# wt -p "Command Prompt" `; split-pane -p "Windows PowerShell" `; split-pane -H wsl.exe
|
|
4
4
|
|
|
5
5
|
# See more settings here: https://docs.microsoft.com/en-us/windows/terminal/
|
machineconfig/profile/create.py
CHANGED
|
@@ -4,11 +4,13 @@ This script Takes away all config files from the computer, place them in one dir
|
|
|
4
4
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
from machineconfig.utils.
|
|
9
|
-
from machineconfig.utils.
|
|
7
|
+
from machineconfig.utils.path_reduced import PathExtended as PathExtended
|
|
8
|
+
from machineconfig.utils.links import symlink_func, symlink_copy
|
|
9
|
+
from machineconfig.utils.options import display_options
|
|
10
|
+
from machineconfig.utils.source_of_truth import LIBRARY_ROOT, REPO_ROOT
|
|
10
11
|
from machineconfig.utils.utils2 import read_toml
|
|
11
12
|
from machineconfig.profile.shell import create_default_shell_profile
|
|
13
|
+
|
|
12
14
|
# import os
|
|
13
15
|
import platform
|
|
14
16
|
import os
|
|
@@ -19,10 +21,14 @@ from typing import Optional, Any, TypedDict
|
|
|
19
21
|
|
|
20
22
|
system = platform.system() # Linux or Windows
|
|
21
23
|
ERROR_LIST: list[Any] = [] # append to this after every exception captured.
|
|
22
|
-
|
|
23
|
-
OTHER_SYSTEM = "windows" if system == "Linux" else "linux"
|
|
24
|
+
|
|
24
25
|
SYSTEM = system.lower()
|
|
25
26
|
|
|
27
|
+
def get_other_systems(current_system: str) -> list[str]:
|
|
28
|
+
all_systems = ["linux", "windows", "darwin"]
|
|
29
|
+
return [s for s in all_systems if s != current_system.lower()]
|
|
30
|
+
OTHER_SYSTEMS = get_other_systems(SYSTEM)
|
|
31
|
+
|
|
26
32
|
|
|
27
33
|
class SymlinkMapper(TypedDict):
|
|
28
34
|
this: str
|
|
@@ -38,24 +44,28 @@ def main_symlinks(choice: Optional[str] = None):
|
|
|
38
44
|
program_keys_raw: list[str] = list(symlink_mapper.keys())
|
|
39
45
|
program_keys: list[str] = []
|
|
40
46
|
for program_key in program_keys_raw:
|
|
41
|
-
if program_key in exclude or
|
|
47
|
+
if program_key in exclude or any([another_system in program_key for another_system in OTHER_SYSTEMS]):
|
|
42
48
|
continue
|
|
43
|
-
else:
|
|
49
|
+
else:
|
|
50
|
+
program_keys.append(program_key)
|
|
44
51
|
|
|
45
52
|
program_keys.sort()
|
|
46
53
|
if choice is None:
|
|
47
54
|
choice_selected = display_options(msg="Which symlink to create?", options=program_keys + ["all", "none(EXIT)"], default="none(EXIT)", fzf=True, multi=True)
|
|
48
55
|
assert isinstance(choice_selected, list)
|
|
49
|
-
if len(choice_selected) == 1 and choice_selected[0] == "none(EXIT)":
|
|
50
|
-
|
|
56
|
+
if len(choice_selected) == 1 and choice_selected[0] == "none(EXIT)":
|
|
57
|
+
return # terminate function.
|
|
58
|
+
elif len(choice_selected) == 1 and choice_selected[0] == "all":
|
|
59
|
+
choice_selected = "all" # i.e. program_keys = program_keys
|
|
51
60
|
# overwrite = display_options(msg="Overwrite existing source file?", options=["yes", "no"], default="yes") == "yes"
|
|
52
61
|
from rich.prompt import Confirm
|
|
53
62
|
overwrite = Confirm.ask("Overwrite existing source file?", default=True)
|
|
54
|
-
else:
|
|
63
|
+
else:
|
|
64
|
+
choice_selected = choice
|
|
55
65
|
|
|
56
66
|
if isinstance(choice_selected, str):
|
|
57
67
|
if str(choice_selected) == "all" and system == "Windows":
|
|
58
|
-
if os.name ==
|
|
68
|
+
if os.name == "nt":
|
|
59
69
|
try:
|
|
60
70
|
is_admin = ctypes.windll.shell32.IsUserAnAdmin()
|
|
61
71
|
except Exception:
|
|
@@ -64,9 +74,9 @@ def main_symlinks(choice: Optional[str] = None):
|
|
|
64
74
|
is_admin = False
|
|
65
75
|
if not is_admin:
|
|
66
76
|
print(f"""
|
|
67
|
-
{
|
|
77
|
+
{"*" * 80}
|
|
68
78
|
⚠️ WARNING: Administrator privileges required
|
|
69
|
-
{
|
|
79
|
+
{"*" * 80}
|
|
70
80
|
""")
|
|
71
81
|
raise RuntimeError("Run terminal as admin and try again, otherwise, there will be too many popups for admin requests and no chance to terminate the program.")
|
|
72
82
|
elif choice_selected == "all":
|
|
@@ -75,14 +85,16 @@ def main_symlinks(choice: Optional[str] = None):
|
|
|
75
85
|
{program_keys}
|
|
76
86
|
""")
|
|
77
87
|
pass # i.e. program_keys = program_keys
|
|
78
|
-
else:
|
|
79
|
-
|
|
88
|
+
else:
|
|
89
|
+
program_keys = [choice_selected]
|
|
90
|
+
else:
|
|
91
|
+
program_keys = choice_selected
|
|
80
92
|
|
|
81
93
|
for program_key in program_keys:
|
|
82
94
|
print(f"\n🔄 Processing {program_key} symlinks...")
|
|
83
95
|
for file_key, file_map in symlink_mapper[program_key].items():
|
|
84
|
-
this = PathExtended(file_map[
|
|
85
|
-
to_this = PathExtended(file_map[
|
|
96
|
+
this = PathExtended(file_map["this"])
|
|
97
|
+
to_this = PathExtended(file_map["to_this"].replace("REPO_ROOT", REPO_ROOT.as_posix()).replace("LIBRARY_ROOT", LIBRARY_ROOT.as_posix()))
|
|
86
98
|
if "contents" in file_map:
|
|
87
99
|
try:
|
|
88
100
|
for a_target in to_this.expanduser().search("*"):
|
|
@@ -113,22 +125,22 @@ def main_symlinks(choice: Optional[str] = None):
|
|
|
113
125
|
|
|
114
126
|
if system == "Linux":
|
|
115
127
|
print("\n📜 Setting executable permissions for scripts...")
|
|
116
|
-
subprocess.run(f
|
|
128
|
+
subprocess.run(f"chmod +x {LIBRARY_ROOT.joinpath(f'scripts/{system.lower()}')} -R", shell=True, capture_output=True, text=True)
|
|
117
129
|
print("✅ Script permissions updated")
|
|
118
130
|
|
|
119
131
|
if len(ERROR_LIST) > 0:
|
|
120
132
|
print(f"""
|
|
121
|
-
{
|
|
133
|
+
{"*" * 80}
|
|
122
134
|
❗ ERRORS ENCOUNTERED DURING PROCESSING
|
|
123
|
-
{
|
|
135
|
+
{"*" * 80}
|
|
124
136
|
{ERROR_LIST}
|
|
125
|
-
{
|
|
137
|
+
{"*" * 80}
|
|
126
138
|
""")
|
|
127
139
|
else:
|
|
128
140
|
print(f"""
|
|
129
|
-
{
|
|
141
|
+
{"*" * 80}
|
|
130
142
|
✅ All symlinks created successfully!
|
|
131
|
-
{
|
|
143
|
+
{"*" * 80}
|
|
132
144
|
""")
|
|
133
145
|
|
|
134
146
|
|
|
@@ -143,11 +155,11 @@ def main(choice: Optional[str] = None):
|
|
|
143
155
|
create_default_shell_profile()
|
|
144
156
|
|
|
145
157
|
print(f"""
|
|
146
|
-
{
|
|
158
|
+
{"=" * 80}
|
|
147
159
|
✨ Configuration setup complete! ✨
|
|
148
|
-
{
|
|
160
|
+
{"=" * 80}
|
|
149
161
|
""")
|
|
150
162
|
|
|
151
163
|
|
|
152
|
-
if __name__ ==
|
|
164
|
+
if __name__ == "__main__":
|
|
153
165
|
pass
|