diff --git a/aura.go b/aura.go index 785ebb58..85fb0815 100644 --- a/aura.go +++ b/aura.go @@ -13,7 +13,7 @@ import ( var cmdAura = &Command{ Usage: "aura", - Short: "force aura push -resourcepath=", + Short: "force aura push -f ", Long: ` The aura command needs context to work. If you execute "aura get" it will create a folder structure that provides the context for @@ -53,8 +53,8 @@ var cmdAura = &Command{ func init() { cmdAura.Run = runAura - cmdAura.Flag.Var(&resourcepath, "p", "fully qualified file name for entity") - cmdAura.Flag.Var(&resourcepath, "f", "fully qualified file name for entity") + cmdAura.Flag.Var(&resourcepaths, "p", "fully qualified file name for entity") + cmdAura.Flag.Var(&resourcepaths, "f", "fully qualified file name for entity") cmdAura.Flag.StringVar(&metadataType, "entitytype", "", "fully qualified file name for entity") cmdAura.Flag.StringVar(&auraentityname, "entityname", "", "fully qualified file name for entity") cmdAura.Flag.StringVar(&metadataType, "t", "", "fully qualified file name for entity") @@ -107,14 +107,14 @@ func runAura(cmd *Command, args []string) { fmt.Println(bundle["DeveloperName"]) } case "push": - // absPath, _ := filepath.Abs(resourcepath[0]) - runPushAura(cmd, resourcepath) + // absPath, _ := filepath.Abs(resourcepaths[0]) + runPushAura(cmd, resourcepaths) } } func runDeleteAura() { - absPath, _ := filepath.Abs(resourcepath[0]) - //resourcepath = absPath + absPath, _ := filepath.Abs(resourcepaths[0]) + //resourcepaths = absPath if InAuraBundlesFolder(absPath) { info, err := os.Stat(absPath) @@ -189,8 +189,8 @@ func deleteAuraDefinitionBundle(manifest BundleManifest) { if err != nil { ErrorAndExit(err.Error()) } - os.Remove(filepath.Join(resourcepath[0], ".manifest")) - os.Remove(resourcepath[0]) + os.Remove(filepath.Join(resourcepaths[0], ".manifest")) + os.Remove(resourcepaths[0]) } func deleteAuraDefinition(manifest BundleManifest, key int) { diff --git a/fetch.go b/fetch.go index d9a67277..242af9fa 100644 --- a/fetch.go +++ b/fetch.go @@ -129,14 +129,7 @@ func persistBundles(bundles AuraDefinitionBundleResult, definitions AuraDefiniti var defRecords = definitions.Records root, err := GetSourceDir() - if mdbase == "aura" { - root = filepath.Join(targetDirectory, root, "aura") - } else { - root = filepath.Join(targetDirectory, root, mdbase, "aura") - } - if err := os.MkdirAll(root, 0755); err != nil { - ErrorAndExit(err.Error()) - } + root = filepath.Join(root, "aura") for key, value := range bundleMap { if err := os.MkdirAll(filepath.Join(root, value), 0755); err != nil { diff --git a/push.go b/push.go index 0345bd30..d013b80e 100644 --- a/push.go +++ b/push.go @@ -45,8 +45,7 @@ Deployment Options var ( namePaths = make(map[string]string) byName = false - resourcepaths string - metaName string + resourcepaths metaName metaFolder string ) diff --git a/pushAura.go b/pushAura.go index f80e874e..0af3c07f 100644 --- a/pushAura.go +++ b/pushAura.go @@ -22,7 +22,7 @@ var cmdPushAura = &Command{ func init() { cmdPushAura.Run = runPushAura - cmdPushAura.Flag.Var(&resourcepath, "f", "fully qualified file name for entity") + cmdPushAura.Flag.Var(&resourcepaths, "f", "fully qualified file name for entity") cmdPushAura.Flag.StringVar(&metadataType, "t", "", "Type of entity or bundle to create") cmdPushAura.Flag.StringVar(&metadataType, "type", "", "Type of entity or bundle to create") } @@ -31,11 +31,11 @@ func runPushAura(cmd *Command, args []string) { // For some reason, when called from sublime, the quotes are included // in the resourcepath argument. Quoting is needed if you have blank spaces // in the path name. So need to strip them out. - if strings.Contains(resourcepath[0], "\"") || strings.Contains(resourcepath[0], "'") { - resourcepath[0] = strings.Replace(resourcepath[0], "\"", "", -1) - resourcepath[0] = strings.Replace(resourcepath[0], "'", "", -1) + if strings.Contains(resourcepaths[0], "\"") || strings.Contains(resourcepaths[0], "'") { + resourcepaths[0] = strings.Replace(resourcepaths[0], "\"", "", -1) + resourcepaths[0] = strings.Replace(resourcepaths[0], "'", "", -1) } - absPath, _ := filepath.Abs(resourcepath[0]) + absPath, _ := filepath.Abs(resourcepaths[0]) if _, err := os.Stat(absPath); os.IsNotExist(err) { fmt.Println(err.Error()) ErrorAndExit("File does not exist\n" + absPath)