dotctl 1.0.7__tar.gz → 1.0.8__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.
- {dotctl-1.0.7/src/dotctl.egg-info → dotctl-1.0.8}/PKG-INFO +1 -1
- {dotctl-1.0.7 → dotctl-1.0.8}/pyproject.toml +1 -1
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/activator.py +3 -3
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/creator.py +2 -2
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/exporter.py +2 -2
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/importer.py +5 -5
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/initializer.py +1 -1
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/puller.py +1 -1
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/remover.py +7 -7
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/saver.py +2 -2
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/switcher.py +5 -5
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/wiper.py +4 -4
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/handlers/git_handler.py +11 -8
- {dotctl-1.0.7 → dotctl-1.0.8/src/dotctl.egg-info}/PKG-INFO +1 -1
- {dotctl-1.0.7 → dotctl-1.0.8}/LICENSE +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/README.md +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/setup.cfg +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/__init__.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/__init__.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/actions/lister.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/arg_manager.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/exception.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/handlers/__init__.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/handlers/config_handler.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/handlers/data_handler.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/handlers/hooks_handler.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/hooks/post_apply.sh +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/hooks/pre_apply.sh +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/main.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/paths.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/templates/__init__.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/templates/dev.yaml +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/templates/kde.yaml +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/templates/other.yaml +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/utils.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl/validators.py +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl.egg-info/SOURCES.txt +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl.egg-info/dependency_links.txt +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl.egg-info/entry_points.txt +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl.egg-info/requires.txt +0 -0
- {dotctl-1.0.7 → dotctl-1.0.8}/src/dotctl.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotctl
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: A powerful CLI tool to profile your OS by saving, applying, exporting, and importing system configurations as named profiles. Designed to manage dot files and service configurations in a centralized Git repository (local or remote), dotctl enables seamless system replication across machines. Supports pre/post hook scripts, making it ideal for setting up servers or desktops with consistent environments.
|
|
5
5
|
Author-email: Pankaj Jackson <pankajackson@live.co.uk>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dotctl"
|
|
7
|
-
version = "v1.0.
|
|
7
|
+
version = "v1.0.8"
|
|
8
8
|
description = "A powerful CLI tool to profile your OS by saving, applying, exporting, and importing system configurations as named profiles. Designed to manage dot files and service configurations in a centralized Git repository (local or remote), dotctl enables seamless system replication across machines. Supports pre/post hook scripts, making it ideal for setting up servers or desktops with consistent environments."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -54,13 +54,13 @@ def apply(props: ActivatorProps) -> None:
|
|
|
54
54
|
checkout_branch(repo, profile)
|
|
55
55
|
log(f"Switched to profile: {profile}")
|
|
56
56
|
else:
|
|
57
|
-
log(f"Profile {profile} is not available.")
|
|
57
|
+
log(f"❌ Profile {profile} is not available.")
|
|
58
58
|
return
|
|
59
59
|
|
|
60
60
|
config = conf_reader(config_file=Path(app_config_file))
|
|
61
61
|
|
|
62
62
|
if pull_changes(repo):
|
|
63
|
-
log("
|
|
63
|
+
log("Pulled latest changes from cloud successfully.")
|
|
64
64
|
|
|
65
65
|
if not props.skip_hooks and not props.skip_pre_hooks:
|
|
66
66
|
run_hooks(
|
|
@@ -95,4 +95,4 @@ def apply(props: ActivatorProps) -> None:
|
|
|
95
95
|
ignore_errors=props.ignore_hook_errors,
|
|
96
96
|
timeout=props.hooks_timeout,
|
|
97
97
|
)
|
|
98
|
-
log("✅ Profile
|
|
98
|
+
log("✅ Profile applied successfully!")
|
|
@@ -53,7 +53,7 @@ def create(props: CreatorProps):
|
|
|
53
53
|
|
|
54
54
|
_, _, _, all_profiles = get_repo_branches(repo)
|
|
55
55
|
if props.profile in all_profiles:
|
|
56
|
-
log(f"Profile '{props.profile}' already exists.")
|
|
56
|
+
log(f"❌ Profile '{props.profile}' already exists.")
|
|
57
57
|
return
|
|
58
58
|
if props.env or props.config:
|
|
59
59
|
if props.config is not None and isinstance(props.config, str):
|
|
@@ -86,4 +86,4 @@ def create(props: CreatorProps):
|
|
|
86
86
|
else:
|
|
87
87
|
push_existing_branch(repo=repo)
|
|
88
88
|
|
|
89
|
-
log(f"Profile '{props.profile}' created and activated successfully.")
|
|
89
|
+
log(f"✅ Profile '{props.profile}' created and activated successfully.")
|
|
@@ -67,7 +67,7 @@ def exporter(props: ExporterProps) -> None:
|
|
|
67
67
|
checkout_branch(repo, profile)
|
|
68
68
|
log(f"Switched to profile: {profile}")
|
|
69
69
|
else:
|
|
70
|
-
log(f"Profile '{profile}' not found.")
|
|
70
|
+
log(f"❌ Profile '{profile}' not found.")
|
|
71
71
|
return
|
|
72
72
|
|
|
73
73
|
# Copy profile files
|
|
@@ -117,7 +117,7 @@ def exporter(props: ExporterProps) -> None:
|
|
|
117
117
|
shutil.move(archive_file, export_profile_path.with_suffix(__EXPORT_EXTENSION__))
|
|
118
118
|
|
|
119
119
|
log(
|
|
120
|
-
f"Successfully exported to {export_profile_path.with_suffix(__EXPORT_EXTENSION__)}"
|
|
120
|
+
f"✅ Successfully exported to {export_profile_path.with_suffix(__EXPORT_EXTENSION__)}"
|
|
121
121
|
)
|
|
122
122
|
finally:
|
|
123
123
|
shutil.rmtree(export_profile_path, ignore_errors=True)
|
|
@@ -40,17 +40,17 @@ importer_default_props = ImporterProps(
|
|
|
40
40
|
def importer(props: ImporterProps) -> None:
|
|
41
41
|
log("Importing profile...")
|
|
42
42
|
if not props.profile:
|
|
43
|
-
log("No profile specified")
|
|
43
|
+
log("❌ No profile specified")
|
|
44
44
|
return
|
|
45
45
|
|
|
46
46
|
profile_path = Path(props.profile)
|
|
47
47
|
|
|
48
48
|
if not is_zipfile(profile_path):
|
|
49
|
-
log("Invalid Profile file")
|
|
49
|
+
log("❌ Invalid Profile file")
|
|
50
50
|
return
|
|
51
51
|
|
|
52
52
|
if profile_path.suffix != __EXPORT_EXTENSION__:
|
|
53
|
-
log("Unsupported Profile file")
|
|
53
|
+
log("❌ Unsupported Profile file")
|
|
54
54
|
return
|
|
55
55
|
|
|
56
56
|
# Setup variables
|
|
@@ -62,7 +62,7 @@ def importer(props: ImporterProps) -> None:
|
|
|
62
62
|
# Create profile branch
|
|
63
63
|
_, remote_profiles, active_profile, all_profiles = get_repo_branches(repo)
|
|
64
64
|
if profile_name in all_profiles:
|
|
65
|
-
log(f"Profile '{profile_name}' already exists")
|
|
65
|
+
log(f"❌ Profile '{profile_name}' already exists")
|
|
66
66
|
return
|
|
67
67
|
|
|
68
68
|
create_branch(repo=repo, branch=profile_name)
|
|
@@ -127,7 +127,7 @@ def importer(props: ImporterProps) -> None:
|
|
|
127
127
|
checkout_branch(repo, active_profile)
|
|
128
128
|
log(f"Switched back to profile: {active_profile}")
|
|
129
129
|
|
|
130
|
-
log("Profile Imported successfully!")
|
|
130
|
+
log("✅ Profile Imported successfully!")
|
|
131
131
|
|
|
132
132
|
finally:
|
|
133
133
|
shutil.rmtree(temp_profile_dir, ignore_errors=True)
|
|
@@ -39,7 +39,7 @@ def remove(props: RemoverProps):
|
|
|
39
39
|
|
|
40
40
|
try:
|
|
41
41
|
if repo.bare:
|
|
42
|
-
print("The repository is bare. No profiles available.")
|
|
42
|
+
print("❌ The repository is bare. No profiles available.")
|
|
43
43
|
return
|
|
44
44
|
|
|
45
45
|
if props.fetch:
|
|
@@ -54,16 +54,16 @@ def remove(props: RemoverProps):
|
|
|
54
54
|
# Delete local branch if it exists
|
|
55
55
|
if profile in local_profiles:
|
|
56
56
|
delete_local_branch(repo, profile)
|
|
57
|
-
log(f"Local profile '{profile}' removed successfully.")
|
|
57
|
+
log(f"✅ Local profile '{profile}' removed successfully.")
|
|
58
58
|
else:
|
|
59
|
-
log(f"Profile '{profile}' does not exist locally.")
|
|
59
|
+
log(f"❎ Profile '{profile}' does not exist locally.")
|
|
60
60
|
|
|
61
61
|
# Delete remote branch if it exists
|
|
62
62
|
if is_remote_repo(repo=repo):
|
|
63
63
|
if profile in remote_profiles:
|
|
64
64
|
if props.no_confirm:
|
|
65
65
|
delete_remote_branch(repo, profile)
|
|
66
|
-
log(f"Remote profile '{profile}' removed successfully.")
|
|
66
|
+
log(f"✅ Remote profile '{profile}' removed successfully.")
|
|
67
67
|
return
|
|
68
68
|
else:
|
|
69
69
|
# Ask for confirmation
|
|
@@ -72,13 +72,13 @@ def remove(props: RemoverProps):
|
|
|
72
72
|
)
|
|
73
73
|
if confirm.lower() == "y":
|
|
74
74
|
delete_remote_branch(repo, profile)
|
|
75
|
-
log(f"Remote profile '{profile}' removed successfully.")
|
|
75
|
+
log(f"✅ Remote profile '{profile}' removed successfully.")
|
|
76
76
|
return
|
|
77
77
|
else:
|
|
78
|
-
log("Remote profile deletion aborted by user.")
|
|
78
|
+
log("🛑 Remote profile deletion aborted by user.")
|
|
79
79
|
return
|
|
80
80
|
|
|
81
|
-
log(f"Profile '{profile}' does not exist on cloud.")
|
|
81
|
+
log(f"❎ Profile '{profile}' does not exist on cloud.")
|
|
82
82
|
|
|
83
83
|
except Exception as e:
|
|
84
84
|
raise Exception(f"Unexpected error: {e}")
|
|
@@ -56,7 +56,7 @@ def save(props: SaverProps) -> None:
|
|
|
56
56
|
create_branch(repo=repo, branch=profile)
|
|
57
57
|
log(f"Profile '{profile}' created and activated successfully.")
|
|
58
58
|
if pull_changes(repo):
|
|
59
|
-
log("
|
|
59
|
+
log("Pulled latest changes from cloud successfully.")
|
|
60
60
|
|
|
61
61
|
config = conf_reader(config_file=Path(app_config_file))
|
|
62
62
|
|
|
@@ -97,4 +97,4 @@ def save(props: SaverProps) -> None:
|
|
|
97
97
|
push_existing_branch(repo=repo)
|
|
98
98
|
log("✅ Profile saved successfully!")
|
|
99
99
|
else:
|
|
100
|
-
log("No changes detected!")
|
|
100
|
+
log("ℹ️ No changes detected!")
|
|
@@ -34,7 +34,7 @@ def switch(props: SwitcherProps):
|
|
|
34
34
|
repo = get_repo(props.profile_dir)
|
|
35
35
|
|
|
36
36
|
if repo.bare:
|
|
37
|
-
log("The repository is bare. No Profile available.")
|
|
37
|
+
log("❌ The repository is bare. No Profile available.")
|
|
38
38
|
sys.exit(1)
|
|
39
39
|
|
|
40
40
|
local_profiles, remote_profiles, active_profile, all_profiles = get_repo_branches(
|
|
@@ -52,7 +52,7 @@ def switch(props: SwitcherProps):
|
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
if profile_name == active_profile:
|
|
55
|
-
log(f"Already on the current profile: {profile_name}")
|
|
55
|
+
log(f"ℹ️ Already on the current profile: {profile_name}")
|
|
56
56
|
return
|
|
57
57
|
|
|
58
58
|
# Fetch remote branches if requested
|
|
@@ -64,10 +64,10 @@ def switch(props: SwitcherProps):
|
|
|
64
64
|
if profile_name in local_profiles:
|
|
65
65
|
# Checkout local branch
|
|
66
66
|
checkout_branch(repo, profile_name)
|
|
67
|
-
log(f"Switched to profile: {profile_name}")
|
|
67
|
+
log(f"✅ Switched to profile: {profile_name}")
|
|
68
68
|
elif profile_name in remote_profiles:
|
|
69
69
|
# Checkout and track remote branch automatically
|
|
70
70
|
checkout_branch(repo, profile_name)
|
|
71
|
-
log(f"Downloaded and switched to new profile from cloud: {profile_name}")
|
|
71
|
+
log(f"✅ Downloaded and switched to new profile from cloud: {profile_name}")
|
|
72
72
|
else:
|
|
73
|
-
log(f"Profile '{profile_name}' is not available in the repository.")
|
|
73
|
+
log(f"❌ Profile '{profile_name}' is not available in the repository.")
|
|
@@ -29,7 +29,7 @@ def wipe(props: WiperProps):
|
|
|
29
29
|
try:
|
|
30
30
|
if props.no_confirm:
|
|
31
31
|
shutil.rmtree(props.profile_dir)
|
|
32
|
-
log(f"Profile directory '{props.profile_dir}' removed successfully.")
|
|
32
|
+
log(f"🗑️ Profile directory '{props.profile_dir}' removed successfully.")
|
|
33
33
|
return
|
|
34
34
|
else:
|
|
35
35
|
# Ask for confirmation
|
|
@@ -42,12 +42,12 @@ def wipe(props: WiperProps):
|
|
|
42
42
|
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
|
43
43
|
backup_dir = f"{props.profile_dir}_backup_{timestamp}"
|
|
44
44
|
shutil.copytree(props.profile_dir, backup_dir)
|
|
45
|
-
log(f"Backup directory '{backup_dir}' created successfully.")
|
|
45
|
+
log(f"💾 Backup directory '{backup_dir}' created successfully.")
|
|
46
46
|
shutil.rmtree(props.profile_dir)
|
|
47
|
-
log(f"Profile directory '{props.profile_dir}' removed successfully.")
|
|
47
|
+
log(f"🗑️ Profile directory '{props.profile_dir}' removed successfully.")
|
|
48
48
|
return
|
|
49
49
|
else:
|
|
50
|
-
log("Profile wipe process aborted by user.")
|
|
50
|
+
log("🛑 Profile wipe process aborted by user.")
|
|
51
51
|
return
|
|
52
52
|
except Exception as e:
|
|
53
53
|
raise Exception(f"Unexpected error: {e}")
|
|
@@ -228,8 +228,8 @@ def push_new_branch(repo: Repo) -> None:
|
|
|
228
228
|
|
|
229
229
|
def pull_changes(repo: Repo) -> bool | None:
|
|
230
230
|
is_remote, origin = is_remote_repo(repo)
|
|
231
|
-
if not is_remote or origin
|
|
232
|
-
log("Warning: Skipping pull
|
|
231
|
+
if not is_remote or not origin:
|
|
232
|
+
log("Warning: Skipping pull from remote repository! Not a remote repo.")
|
|
233
233
|
return None
|
|
234
234
|
|
|
235
235
|
if repo.bare:
|
|
@@ -237,17 +237,20 @@ def pull_changes(repo: Repo) -> bool | None:
|
|
|
237
237
|
|
|
238
238
|
git_fetch(repo)
|
|
239
239
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
_, remote_profiles, active_profile, _ = get_repo_branches(repo)
|
|
241
|
+
|
|
242
|
+
if active_profile not in remote_profiles:
|
|
243
|
+
return None
|
|
244
|
+
|
|
245
|
+
local_commit = repo.commit(active_profile)
|
|
246
|
+
remote_commit = repo.commit(f"origin/{active_profile}")
|
|
243
247
|
|
|
244
248
|
if local_commit.hexsha == remote_commit.hexsha:
|
|
245
249
|
return None
|
|
246
250
|
|
|
247
251
|
log("📥 Update found:")
|
|
248
|
-
for commit in repo.iter_commits(f"{
|
|
249
|
-
log(f"
|
|
250
|
-
|
|
252
|
+
for commit in repo.iter_commits(f"{active_profile}..origin/{active_profile}"):
|
|
253
|
+
log(f" - {commit.summary} ({commit.hexsha[:7]})")
|
|
251
254
|
origin.pull()
|
|
252
255
|
return True
|
|
253
256
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotctl
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: A powerful CLI tool to profile your OS by saving, applying, exporting, and importing system configurations as named profiles. Designed to manage dot files and service configurations in a centralized Git repository (local or remote), dotctl enables seamless system replication across machines. Supports pre/post hook scripts, making it ideal for setting up servers or desktops with consistent environments.
|
|
5
5
|
Author-email: Pankaj Jackson <pankajackson@live.co.uk>
|
|
6
6
|
License-Expression: MIT
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|