Skip to content

Commit

Permalink
Merge pull request #36 from Prayag2/dev
Browse files Browse the repository at this point in the history
Fixed an important bug. Please read the changelog for more info.
  • Loading branch information
Prayag2 authored Apr 13, 2021
2 parents 45ba48c + 7609488 commit 3630706
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.2] - 2021-04-13
### Fixed
- Fixed a bug with export. Previously, exporting a profile would export the current profile but now it will export the specified profile.
- Fixed a typo in the readme

## Added
- Added a line in the readme

## [2.0.1] - 2021-04-11
### Removed
- KDE Plasma won't be restarted after applying a new configuration now. You'll have to restart it yourself. This was done because using Konsave on other DEs would give an error.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align=center> Konsave (Save Linux Customization) </h1>
<p align=center>A CLI program that will let you save and apply your Linux customizations with just one command! It officially supports KDE Plasma but it can be used on all other desktop environments too!</p>
<p align=center>A CLI program that will let you save and apply your Linux customizations with just one command! Konsave also lets you share your dot files to your friends in an instant! It officially supports KDE Plasma but it can be used on all other desktop environments too!</p>

---

Expand Down Expand Up @@ -79,7 +79,7 @@ save:
- file2
- folder1
- folder2
export
export:
anotherName:
location: "another/path/to/parent/directory"
entries:
Expand Down
36 changes: 20 additions & 16 deletions konsave/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,22 +277,26 @@ def export(profile_id, profile_list, profile_count):
profile_config_file = os.path.join(profile_dir, "conf.yaml")
konsave_config = read_konsave_config(profile_config_file)

for section in konsave_config:
section_folder = os.path.join(export_path, section)
mkdir(section_folder)
for sub_section in konsave_config[section]:
location = konsave_config[section][sub_section]["location"]
path = os.path.join(section_folder, sub_section)
mkdir(path)
for entry in konsave_config[section][sub_section]["entries"]:
source = os.path.join(location, entry)
dest = os.path.join(path, entry)
log(f'Exporting "{entry}"...')
if os.path.exists(source):
if os.path.isdir(source):
copy(source, dest)
else:
shutil.copy(source, dest)
export_path_save = mkdir(os.path.join(export_path, "save"))
for name in konsave_config["save"]:
location = os.path.join(profile_dir, name)
log(f'Exporting "{name}"...')
copy(location, os.path.join(export_path_save, name))

konsave_config_export = konsave_config["export"]
export_path_export = mkdir(os.path.join(export_path, "export"))
for name in konsave_config_export:
location = konsave_config_export[name]["location"]
path = mkdir(os.path.join(export_path_export, name))
for entry in konsave_config_export[name]["entries"]:
source = os.path.join(location, entry)
dest = os.path.join(path, entry)
log(f'Exporting "{entry}"...')
if os.path.exists(source):
if os.path.isdir(source):
copy(source, dest)
else:
shutil.copy(source, dest)

shutil.copy(CONFIG_FILE, export_path)

Expand Down

0 comments on commit 3630706

Please sign in to comment.