twres: fix folder copy on dirty builds

Add MkdirAll before trying to copy to twres folder

Change-Id: I66f150828f804fd36bbcfd2bc9ee17c54761d672
This commit is contained in:
Captain Throwback
2022-02-18 12:55:42 -05:00
parent bee26852ce
commit fcb99a2cb5
+2
View File
@@ -42,6 +42,7 @@ func printCustomThemeWarning(theme string, location string) {
func copyThemeResources(ctx android.BaseContext, dirs []string, files []string) {
outDir := ctx.Config().Getenv("OUT")
twRes := outDir + "/recovery/root/twres/"
os.MkdirAll(twRes, os.ModePerm)
recoveryDir := getRecoveryAbsDir(ctx)
theme := determineTheme(ctx)
for idx, dir := range dirs {
@@ -68,6 +69,7 @@ func copyThemeResources(ctx android.BaseContext, dirs []string, files []string)
func copyCustomTheme(ctx android.BaseContext, customTheme string) {
outDir := ctx.Config().Getenv("OUT")
twRes := outDir + "/recovery/root/twres/"
os.MkdirAll(twRes, os.ModePerm)
fileDest := twRes + path.Base(customTheme)
fileToCopy := fmt.Sprintf("%s%s", getBuildAbsDir(ctx), customTheme)
copyFile(fileToCopy, fileDest)