Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15334030
D21588.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
887 B
Referenced Files
None
Subscribers
None
D21588.diff
View Options
diff --git a/src/config/source/ArcanistFilesystemConfigurationSource.php b/src/config/source/ArcanistFilesystemConfigurationSource.php
--- a/src/config/source/ArcanistFilesystemConfigurationSource.php
+++ b/src/config/source/ArcanistFilesystemConfigurationSource.php
@@ -39,7 +39,20 @@
$content = id(new PhutilJSON())
->encodeFormatted($values);
- Filesystem::writeFile($this->path, $content);
+ $path = $this->path;
+
+ // If the containing directory does not exist yet, create it.
+ //
+ // This is expected when (for example) you first write to project
+ // configuration in a Git working copy: the ".git/arc" directory will
+ // not exist yet.
+
+ $dir = dirname($path);
+ if (!Filesystem::pathExists($dir)) {
+ Filesystem::createDirectory($dir, 0755, $recursive = true);
+ }
+
+ Filesystem::writeFile($path, $content);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 9, 6:21 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7387046
Default Alt Text
D21588.diff (887 B)
Attached To
Mode
D21588: In Arcanist, when trying to write to a file configuration source, create missing directories
Attached
Detach File
Event Timeline
Log In to Comment