Skip to content

Commit

Permalink
Passes the config file name instead of source to the hook
Browse files Browse the repository at this point in the history
Reason: The config file identifies the source, but it may not be easy to find
the source from config file.

Related: Issue #24
  • Loading branch information
hirak99 committed Nov 13, 2023
1 parent 06c0811 commit a5564b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ keep_monthly = 0
keep_yearly = 0

# Uncomment example to specify scripts to run after yabsnap creates or deletes any snap.
# If any creation / deletion operation occurs, each script will be called with the `source` as an
# argument. Use space as delimiter to specify multiple scripts.
# Use space as delimiter to specify multiple scripts if desired.
# If any creation / deletion operation occurs, each script will be called once.
# Example -
# post_transaction_scripts = "/home/me/script1.sh" "/home/me/script2.sh"
```
Expand Down
2 changes: 1 addition & 1 deletion src/code/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def mount_path(self) -> str:

def call_post_hooks(self) -> None:
for script in self.post_transaction_scripts:
os_utils.run_user_script(script, [self.source])
os_utils.run_user_script(script, [self.config_file])


def iterate_configs(source: Optional[str]) -> Iterator[Config]:
Expand Down
4 changes: 2 additions & 2 deletions src/code/example_config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ keep_monthly = 0
keep_yearly = 0

# Uncomment example to specify scripts to run after yabsnap creates or deletes any snap.
# If any creation / deletion operation occurs, each script will be called with the `source` as an
# argument. Use space as delimiter to specify multiple scripts.
# Use space as delimiter to specify multiple scripts if desired.
# If any creation / deletion operation occurs, each script will be called once.
# Example -
# post_transaction_scripts = "/home/me/script1.sh" "/home/me/script2.sh"

0 comments on commit a5564b5

Please sign in to comment.