fix: pnpm permissions in dev mode (#3386)

* fix: pnpm permissions

* Update cmd_bootstrap.go

Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
This commit is contained in:
Manuel Nuñez 2022-05-18 00:12:39 -03:00 committed by GitHub
parent 0ee779250c
commit 3a8fdb3be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,18 @@ func createTemporaryDirectory() {
} }
} }
func createPNPMDirectory() {
home := os.Getenv("HOME")
if home != "" {
bootstrapPrintln("Creating ", home+"/.pnpm-store")
err := os.MkdirAll(home+"/.pnpm-store", 0755)
if err != nil {
panic(err)
}
}
}
func bootstrapPrintln(args ...interface{}) { func bootstrapPrintln(args ...interface{}) {
a := make([]interface{}, 0) a := make([]interface{}, 0)
a = append(a, "[BOOTSTRAP]") a = append(a, "[BOOTSTRAP]")
@ -230,6 +242,7 @@ func Bootstrap(cobraCmd *cobra.Command, args []string) {
} }
createTemporaryDirectory() createTemporaryDirectory()
createPNPMDirectory()
bootstrapPrintln("Preparing /etc/hosts to serve subdomains of example.com...") bootstrapPrintln("Preparing /etc/hosts to serve subdomains of example.com...")
prepareHostsFile() prepareHostsFile()