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

build-workflow.sh: do not include variables that should not be exported #107

Closed
wants to merge 1 commit into from
Closed

Conversation

vitorgalvao
Copy link

@vitorgalvao vitorgalvao commented Dec 21, 2016

I use a custom zsh function to package, commit, push to the repo, open Packal, copy message to clipboard ready to paste to the forum, etc, when I make a workflow update.

Just now it hit me there’s a Don't Export option for Workflow Environment Variables. That means Alfred knows not to export them, but zipping won’t take that into account. Made a quick test and confirmed that is indeed the case. Then I remembered seeing a script of yours (this one) that packaged workflows (though my memory failed me on the language, as I though the script itself was python). Came looking to see if you had solved that or it had escaped us both.

A few modifications to my my function later, arrived at something similar to this (changed here to better fit with the style of your script).

Quite simply, it:

  1. Checks if info.plist has variablesdontexport.
  2. If it doesn’t, proceed as usual.
  3. If it does, copy the entire workflow to a temporary directory (we’ll make changes to the info.plist and don’t want to do them on our current one).
  4. Check every variable in variablesdontexport and set them to empty values (we don’t want to delete them, else the reference would be lost as well).

I’ll likely make a post on the forum briefly on this, but wanted to go ahead and submit this to you as well.

@vitorgalvao vitorgalvao deleted the patch-1 branch December 21, 2016 14:37
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.

None yet

1 participant