this repo has no description smallweb.run
smallweb
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

add --name flag to sync command for custom session naming

pomdtr c88625a2 520f62c6

+13 -4
+13 -4
cmd/sync.go
··· 4 4 "fmt" 5 5 "os" 6 6 "os/exec" 7 - "strings" 8 7 9 8 "github.com/spf13/cobra" 10 9 ) 11 10 12 11 func NewCmdSync() *cobra.Command { 13 - return &cobra.Command{ 12 + var flags struct { 13 + name string 14 + } 15 + 16 + cmd := &cobra.Command{ 14 17 Use: "sync <remote>", 15 18 Short: "Sync the smallweb config with the filesystem", 16 19 PreRunE: func(cmd *cobra.Command, args []string) error { ··· 21 24 alpha := args[0] 22 25 beta := k.String("dir") 23 26 24 - syncName := strings.Replace(k.String("domain"), ".", "-", -1) 25 - command := exec.Command("mutagen", "sync", "create", fmt.Sprintf("--name=%s", syncName), "--ignore=node_modules,.DS_Store", "--ignore-vcs", "--mode=two-way-resolved", alpha, beta) 27 + command := exec.Command("mutagen", "sync", "create", "--ignore=node_modules,.DS_Store", "--ignore-vcs", "--mode=two-way-resolved", alpha, beta) 28 + 29 + if flags.name != "" { 30 + command.Args = append(command.Args, "--name", flags.name) 31 + } 26 32 27 33 command.Stdout = os.Stdout 28 34 command.Stderr = os.Stderr ··· 34 40 return nil 35 41 }, 36 42 } 43 + 44 + cmd.Flags().StringVar(&flags.name, "name", "", "The name of the sync session") 45 + return cmd 37 46 } 38 47 39 48 func checkMutagen() error {