Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

config: add touch command to ensure config exists at configured location (#5226)

albertony7b1ca716bf1d
diff --git a/cmd/config/config.go b/cmd/config/config.go
index 88c8e937b..7e6f3fc23 100644
--- a/cmd/config/config.go
+++ b/cmd/config/config.go
@@ -22,6 +22,7 @@ func init() {
cmd.Root.AddCommand(configCommand)
configCommand.AddCommand(configEditCommand)
configCommand.AddCommand(configFileCommand)
+ configCommand.AddCommand(configTouchCommand)
configCommand.AddCommand(configShowCommand)
configCommand.AddCommand(configDumpCommand)
configCommand.AddCommand(configProvidersCommand)
@@ -63,6 +64,15 @@ var configFileCommand = &cobra.Command{
},
}
+var configTouchCommand = &cobra.Command{
+ Use: "touch",
+ Short: `Ensure configuration file exists.`,
+ Run: func(command *cobra.Command, args []string) {
+ cmd.CheckArgs(0, 0, command, args)
+ config.SaveConfig()
+ },
+}
+
var configShowCommand = &cobra.Command{
Use: "show [<remote>]",
Short: `Print (decrypted) config file, or the config for a single remote.`,