Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add User-Defined After-Init Hook #27

Merged
merged 1 commit into from
Jan 28, 2024
Merged

Conversation

kilo52
Copy link
Member

@kilo52 kilo52 commented Jan 26, 2024

Adds the capability of defining a user-specific after-init hook.

The declared script hook gets executed by the init system after a project has been initialized. It works analogously to the after-init hook of an addon, but is completely independent of it. This means that no addon has to be loaded at all for a user-specific hook to take effect. However, when both an addon after-init hook as well as a user-defined after-init hook is available, the hook from the addon is first executed and then the user-defined hook.

A user-defined after-init hook must be declared by the project.properties configuration file of the user. It must be declared by the property with key 'sys.user.hook.afterinit'. The property value must be a relative path to the hook script file. The path is relative to the user's home directory.

This feature adds the capability of defining a user-specific after-init hook,
which gets executed by the init system after a project has been initialized.
It works analogously to the after-init hook of an addon, but is completely
independent of it. This means that no addon has to be loaded at all for a
user-specific hook to take effect. However, when both an addon after-init
hook as well as a user-defined after-init hook is available, the hook from
the addon is first executed and then the user-defined hook.

A user-defined after-init hook must be declared by the project.properties
configuration file of the user. It must be declared by the property with
key 'sys.user.hook.afterinit'. The property value must be a relative path
to the hook script file. The path is relative to the user's home directory.
@kilo52 kilo52 added Feature New feature Addons Affects the addon mechanism labels Jan 26, 2024
@kilo52 kilo52 linked an issue Jan 26, 2024 that may be closed by this pull request
@kilo52 kilo52 merged commit 703a15b into master Jan 28, 2024
4 checks passed
@kilo52 kilo52 deleted the feature/user-defined-hook branch January 29, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Addons Affects the addon mechanism Feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User-Defined Hooks
1 participant