-
Notifications
You must be signed in to change notification settings - Fork 305
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
Task assembly #284
Task assembly #284
Changes from 30 commits
cea3129
084e165
3d59092
dcf1b03
f0ae7e9
dfff660
d9c20af
ec5d60f
4b3f964
5f66ab3
254c647
009fcde
269e6d0
40b1bf5
ff7850b
eb0d5c7
3990a7c
f7ef6dc
8e40124
729202a
8a014a8
12b1255
426cf5f
3ee6235
8388ce3
cd4fbed
9e0c4b0
bf25add
ac88ae9
9b31b4e
a1515f6
d141895
699d388
cf079a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
language: php | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -346,4 +346,46 @@ public function trySuccess() | |
{ | ||
$result = $this->taskExec('pwd')->run(); | ||
} | ||
|
||
public function tryDeprecated() | ||
{ | ||
$result = (new \Robo\Task\Base\Exec('pwd'))->run(); | ||
} | ||
|
||
public function tryTmpDir() | ||
{ | ||
// Set up a collection to add tasks to | ||
$collection = $this->collection(); | ||
|
||
// Get a temporary directory to work in. Note that we get a | ||
// name back, but the directory is not created until the task | ||
// runs. This technically is not thread-safe, but we create | ||
// a random name, so it is unlikely to conflict. | ||
$tmpPath = $this->taskTmpDir() | ||
->addToCollection($collection) | ||
->getPath(); | ||
|
||
// We can create the temporary directory early by running | ||
// 'runWithoutCompletion()'. n.b. if we called 'run()' at | ||
// this point, the collection's 'complete()' method would be | ||
// called, and the temporary directory would be deleted. | ||
$mktmpResult = $collection->runWithoutCompletion(); | ||
|
||
if (is_dir($tmpPath)) { | ||
$this->say("Created a temporary directory at $tmpPath"); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found |
||
else { | ||
$this->say("Requested a temporary directory at $tmpPath, but it was not created"); | ||
} | ||
|
||
// Run the task collection | ||
$result = $collection->run(); | ||
|
||
if (is_dir($tmpPath)) { | ||
$this->say("The temporary directory at $tmpPath was not cleaned up after the collection completed."); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected 1 space after closing brace; newline found |
||
else { | ||
$this->say("The temporary directory at $tmpPath was automatically deleted."); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 1 space after closing brace; newline found