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

feat: add archive.rewrite_paths option [WIP] #1351

Closed
wants to merge 1 commit into from

Conversation

ostrowr
Copy link
Contributor

@ostrowr ostrowr commented Feb 17, 2020

Allow a user to specify a source and dest for some (list of) files in the archive
and name the archived file at source, dest.

If applied, this commit will add a new archive.rewrite_paths option to the yaml config. This is a list of source, dest pairs where sources are files that are to be added to the archive, and dests are what we want them to be called within the archive.

This change pairs with
#1350 as it allows you to do something like include a different file per-OS, but called the same thing

and also fixes #679.

This is one of many ways that this feature could be implemented. If you're interested in including this, I still need to

  • write docs for the new feature
  • add tests, especially around moving whole directories
  • determine what should happen if the source doesn't exist
  • improve various error conditions

Allow a user to specify a `source` and `dest` for some (list of) files in the archive
and name the archived file at `source`, `dest`.
@codecov-io
Copy link

Codecov Report

Merging #1351 into master will decrease coverage by 0.21%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1351      +/-   ##
==========================================
- Coverage   83.88%   83.67%   -0.22%     
==========================================
  Files          57       57              
  Lines        3327     3338      +11     
==========================================
+ Hits         2791     2793       +2     
- Misses        456      464       +8     
- Partials       80       81       +1
Impacted Files Coverage Δ
pkg/config/config.go 100% <ø> (ø) ⬆️
internal/pipe/archive/archive.go 91.22% <16.66%> (-5.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c01783...654e96b. Read the comment docs.

@ostrowr
Copy link
Contributor Author

ostrowr commented Feb 18, 2020

@caarlos0 if this is something you're interested in including, let me know and I'll work on the remaining tasks above! Otherwise, feel free to close this.

@caarlos0
Copy link
Member

I think a better solution would be to make archive.Files have a structure similar to release.Files... will see if I can do something like that soon

@ostrowr
Copy link
Contributor Author

ostrowr commented Feb 19, 2020

I'm not sure how that would work if files need to be renamed/within subdirectories.

Specifically, imagine you want to include a macOS .app file (which is really a directory.) Just including the last part of the path will flatten that directory and the app will become invalid.

@caarlos0
Copy link
Member

caarlos0 commented Mar 4, 2020

I'm not sure how that would work if files need to be renamed/within subdirectories.

Specifically, imagine you want to include a macOS .app file (which is really a directory.) Just including the last part of the path will flatten that directory and the app will become invalid.

I think this should work fine, can you test it?

@ostrowr
Copy link
Contributor Author

ostrowr commented Mar 9, 2020

yep! I'll rebase + test by the end of the week.

@stale
Copy link

stale bot commented Mar 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 23, 2020
@stale stale bot closed this Mar 30, 2020
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File placement inside a archive
3 participants