Page MenuHomePhabricator

D7762.diff

diff --git a/src/future/exec/ExecFuture.php b/src/future/exec/ExecFuture.php
--- a/src/future/exec/ExecFuture.php
+++ b/src/future/exec/ExecFuture.php
@@ -186,6 +186,29 @@
}
+ /**
+ * Set the value of a specific environmental variable for this command.
+ *
+ * @param string Environmental variable name.
+ * @param string|null New value, or null to remove this variable.
+ * @return this
+ * @task config
+ */
+ public function updateEnv($key, $value) {
+ if (!is_array($this->env)) {
+ $this->env = $_ENV;
+ }
+
+ if ($value === null) {
+ unset($this->env[$key]);
+ } else {
+ $this->env[$key] = $value;
+ }
+
+ return $this;
+ }
+
+
/* -( Interacting With Commands )------------------------------------------ */

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/gp/kc/k2cewmw7sd34d6kk
Default Alt Text
D7762.diff (779 B)

Event Timeline