-
Notifications
You must be signed in to change notification settings - Fork 19
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
If the scripts happen to be paths that exist load them #93
Conversation
Here are the changes I did to the diff --git a/Cargo.toml b/Cargo.toml
index 2c7a834..ee51db3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,3 +29,4 @@ assets = [
{ source = "LICENSE", dest = "/usr/share/doc/cargo-generate-rpm/LICENSE", doc = true, mode = "0644" },
{ source = "README.md", dest = "/usr/share/doc/cargo-generate-rpm/README.md", doc = true, mode = "0644" }
]
+pre_install_script = "pre.sh" Here's the bash script I made:
Here's it working and the files included.
Please LMK if you need anything else or would like any changes. I was thinking about making a macro if you think that would be better. Thank you! |
@jtk18 Thank you for new feature implementation. Two issues.
Your code lacks consideration of workspace. It is appropriate to check the relative path from the package base as well as the current directory base for the file path base, as like the asset does.
You can see this process at the bottom of the generate_expanded_path() function in file_info.rs.
This is very trivial, but please update README.md. Short concise changes are enough. For example, optional string or file path of xxxx_install_script. |
This is an attempt to resolve issue 86. This way if the script is a path, we can load that into the RPM instead of relying on installing the script manually.
Thanks for pointing out the issues. I think this change covers it, but I wasn't sure since I don't have a workspace project to test on. This change works w/ the previous testing I had done and if the asset isn't a path. Please LMK if I missed anything or you'd like changes. Thank you! |
There is small incompatibility in case of specifying just shell script of post_install_script = "/usr/share/foobar/postinst $*" or post_install_script = """
/usr/share/foobar/postinst
""" |
Thanks a lot! |
This is an attempt to resolve issue 86. This way if the script is a path, we can load that into the RPM instead of relying on installing the script manually.