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

Source bash tasks instead of executing them #11760

Merged
merged 5 commits into from
Dec 16, 2019
Merged

Conversation

damccorm
Copy link

  • Check a variable AZP_BASHV3_OLD_SOURCE_BEHAVIOR. If it's true, use the old (current) behavior.
  • Otherwise, check the executable bit. If set, run the script.
  • If not set, throw a warning and use the old behavior. This warning will include a pointer to docs which illustrate the back-compat variable.

Fixes #7934

We did this in #9534 and then had to revert in #11571 because of an error, you can see that I'm not making the same mistake here (I've called out where it was) and I've added testing

@damccorm damccorm requested a review from jtpetty as a code owner November 13, 2019 18:45
contents = `. '${targetFilePath.replace("'", "'\\''")}' ${input_arguments}`.trim();
} else {
// Check if executable bit is set
let stats: fs.Stats = tl.stats(input_filePath);
Copy link
Author

Choose a reason for hiding this comment

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

This is where the mistake was last time - in the last iteration of this PR, I was doing a stats call on targetFilePath instead of input_filePath. This is a problem because targetFilePath gets some modifications on just windows so that it will work with bash, that cause stats to fail.

@zachariahcox
Copy link

@stephenmichaelf are you okay with this change?

@damccorm
Copy link
Author

@stephenmichaelf could you take a look?

Copy link
Member

@stephenmichaelf stephenmichaelf left a comment

Choose a reason for hiding this comment

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

Approving with comments.

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.

Bash V3 task sources script instead of executing it
3 participants