Skip to content

Can the pkg folder in built .tgz be renamed? #58

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jswalden
Copy link
Contributor

@jswalden jswalden commented Mar 4, 2025

The manual installation instructions I have to provide for module releases currently instruct people to download a .tar.gz file, then extract it into a companion-module-dev/ folder they've created to hold a manually installed module. I then have to explicitly say that the resulting pkg directory can be renamed, if they in fact have more than one locally installed module. It would be nice if the generated pkg.tgz's top-level folder were reasonably distinctly named so that this extra rename step every time isn't necessary.

(I concede that in the 4.0 era shortly upon us, this concern is substantially vitiated.)

These two revs implement this change.

The first is a minor refactor that eliminates repeated mention of pkg everywhere, instead using path.join with a variable that refers to the pkg directory. I think you can, and should, just take this immediately, no fuss or muss -- regardless whether this issue is worth fixing. It doesn't change anything about the resulting package. But it does meaningfully reduce repetition of the "pkg" magic string, which makes the script cleaner code.

The second changes from generating files into pkg/ and packaging that up, to generating into pkg/${moduleName} and packaging that up. It works exactly fine to implement the change I desire here. However, it looks like this would plainly break (at minimum -- maybe there's more than this that it breaks?) the bundled-modules update workflow -- even as that workflow seems like it would probably prefer for the pkg folder to be named something different (and possibly even what this change would make it be named).

Anyway. At this point, I think need some feedback about whether there is any interest in part 2 of this, and whether there are any other places that would require changes to deal with a non-pkg-named directory besides that script, before I proceed any further here. 🙂

@Julusian
Copy link
Member

Julusian commented Mar 6, 2025

It looks like I wrote the code inside companion to handle the root folder being on an unknown same, so I think this would be fine to do

@Julusian
Copy link
Member

Julusian commented Mar 6, 2025

This will break some of the workflow in https://github.com/bitfocus/companion-bundled-modules/blob/main/.github/workflows/portal-update-module.yml, but I have been trying to remove that portion for a little while now, so I am not worried

…ed on the module name, not just a generic `pkg`.
@jswalden jswalden force-pushed the rename-pkg-folder-in-tgz-build branch from 9f80cda to ac5bd3b Compare March 7, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants