Commit 48a0d166 authored by Addshore's avatar Addshore 🏄
Browse files

Create user .composer dir for cache if it doesn't exist

Bug: T288309
Change-Id: Id89c6a6603fb478470702704c8d23230cdd31072
parent d8e029c3
......@@ -92,6 +92,14 @@ var mwddMediawikiCmd = &cobra.Command{
// Default the mediawiki container to a .composer directory in the running users home dir
if !mwdd.Env().Has("MEDIAWIKI_VOLUMES_DOT_COMPOSER") {
usrComposerDirectory := usrDir + "/.composer"
if _, err := os.Stat(usrComposerDirectory); os.IsNotExist(err) {
err := os.Mkdir(usrComposerDirectory, 0755)
if err != nil {
fmt.Println("Failed to create directory needed for a composer cache")
os.Exit(1)
}
}
mwdd.Env().Set("MEDIAWIKI_VOLUMES_DOT_COMPOSER", usrDir+"/.composer")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment