5
5
"github.com/spf13/cobra"
6
6
"github.com/wttech/aemc/pkg"
7
7
"github.com/wttech/aemc/pkg/common/pathx"
8
+ "github.com/wttech/aemc/pkg/common/timex"
8
9
"github.com/wttech/aemc/pkg/content"
9
10
"os"
10
11
"path/filepath"
@@ -76,6 +77,9 @@ func (c *CLI) contentDownloadCmd() *cobra.Command {
76
77
return
77
78
}
78
79
pid , _ := cmd .Flags ().GetString ("pid" )
80
+ if pid == "" {
81
+ pid = fmt .Sprintf ("aemc:content-download:%s-SNAPSHOT" , timex .FileTimestampForNow ())
82
+ }
79
83
targetFile , _ := cmd .Flags ().GetString ("target-file" )
80
84
filterRoots := determineFilterRoots (cmd )
81
85
filterFile , _ := cmd .Flags ().GetString ("filter-file" )
@@ -133,6 +137,7 @@ func (c *CLI) contentPullCmd() *cobra.Command {
133
137
replace , _ := cmd .Flags ().GetBool ("replace" )
134
138
if dir != "" {
135
139
if err = instance .ContentManager ().PullDir (dir , clean , vault , replace , pkg.PackageCreateOpts {
140
+ PID : fmt .Sprintf ("aemc:content-pull:%s-SNAPSHOT" , timex .FileTimestampForNow ()),
136
141
FilterRoots : filterRoots ,
137
142
FilterFile : filterFile ,
138
143
}); err != nil {
@@ -142,6 +147,7 @@ func (c *CLI) contentPullCmd() *cobra.Command {
142
147
c .SetOutput ("dir" , dir )
143
148
} else if file != "" {
144
149
if err = instance .ContentManager ().PullFile (file , clean , vault , pkg.PackageCreateOpts {
150
+ PID : fmt .Sprintf ("aemc:content-pull:%s-SNAPSHOT" , timex .FileTimestampForNow ()),
145
151
FilterRoots : filterRoots ,
146
152
ExcludePatterns : excludePatterns ,
147
153
}); err != nil {
@@ -196,6 +202,7 @@ func (c *CLI) contentPushCmd() *cobra.Command {
196
202
clean , _ := cmd .Flags ().GetBool ("clean" )
197
203
vault , _ := cmd .Flags ().GetBool ("vault" )
198
204
if err = instance .ContentManager ().Push (path , clean , vault , pkg.PackageCreateOpts {
205
+ PID : fmt .Sprintf ("aemc:content-push:%s-SNAPSHOT" , timex .FileTimestampForNow ()),
199
206
FilterRoots : filterRoots ,
200
207
ExcludePatterns : excludePatterns ,
201
208
ContentPath : path ,
@@ -241,6 +248,7 @@ func (c *CLI) contentCopyCmd() *cobra.Command {
241
248
clean , _ := cmd .Flags ().GetBool ("clean" )
242
249
vault , _ := cmd .Flags ().GetBool ("vault" )
243
250
if err = instance .ContentManager ().Copy (targetInstance , clean , vault , pkg.PackageCreateOpts {
251
+ PID : fmt .Sprintf ("aemc:content-copy:%s-SNAPSHOT" , timex .FileTimestampForNow ()),
244
252
FilterRoots : filterRoots ,
245
253
FilterFile : filterFile ,
246
254
}); err != nil {
0 commit comments