Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Conversation

@patrickbussmann
Copy link

I want to use this bundle on a Amazon ElasticBeanstalk Environment.
If I want to use 7zip I must install it via this command.

yum -y --enablerepo=epel install p7zip

And then I can execute it via 7za.
But in this bundle the default is 7z so I cant execute them.

Linux solution will be to make a symlink from 7z to 7za. This should work, too. (Temporarily)

But on my windows development environment I want to test it, too - without changing path variable. So now I can add executable: 'C:\Program Files\7-Zip\7z.exe' to config.yml and it works.
Other solution is to add it to path.

I added this functionality for zip, too. But not for tar because then we need two executable paths.

Copy link
Collaborator

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @patrickbussmann.

I like this change. I just had some minor comments.

processor:
type: tar # Required: tar|zip|7z
options:
executable: zip|7z # If not added to path variable please set binary path for zip and 7z! e.g. on Windows: 'C:\Program Files\7-Zip\7z.exe'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure I understand this comment. Is "zip|7z" default value?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the default decides which executable to use. So if type is set to zip the executable is zip and if its set to 7z then the executable is 7z. If you use tar as type its ignored because tar and bzip is used.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to specify the possibilities right in the comment, otherwise it's a little bit confusing.

}

return sprintf('cd %s && zip %s %s .', $basePath, implode(' ', $params), $archivePath);
$binaryFile = escapeshellarg(isset($this->options['executable']) ? $this->options['executable'] : 'zip');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

}

return sprintf('cd %s && 7z a %s %s', $basePath, implode(' ', $params), $archivePath);
$binaryFile = escapeshellarg(isset($this->options['executable']) ? $this->options['executable'] : '7z');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be shortened to $binaryFile = escapeshellarg($this->options['executable'] ?: '7z');

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants