docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
RootCmd.AddCommand(Cancel2FACmd) | <mask> },
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(cancel2FACmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(versionCmd)
</s> add RootCmd.AddCommand(VersionCmd) </s> remove rootCmd.AddCommand(restartCmd)
</s> add RootCmd.AddCommand(RestartCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(serverCmd)
</s> add RootCmd.AddCommand(ServerCmd) </s> remove rootCmd.AddCommand(langCmd)
</s> add RootCmd.AddCommand(LangCmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/cancel2FA.go |
// LangCmd represents the lang command
var LangCmd = &cobra.Command{ | <mask> writeFile("settings", settingsLang)
<mask> //utils.WriteJsonToFile("lang/settings.json", settingsLang)
<mask> }
<mask>
<mask> // langCmd represents the lang command
<mask> var langCmd = &cobra.Command{
<mask> Use: "lang",
<mask> Short: "Generate language json file",
<mask> Run: func(cmd *cobra.Command, args []string) {
<mask> err := os.MkdirAll("lang", 0777)
<mask> if err != nil {
</s> feat: export all cmd (#2746) </s> remove if err := rootCmd.Execute(); err != nil {
</s> add if err := RootCmd.Execute(); err != nil { </s> remove // cancel2FACmd represents the delete2fa command
var cancel2FACmd = &cobra.Command{
</s> add // Cancel2FACmd represents the delete2fa command
var Cancel2FACmd = &cobra.Command{ </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ </s> remove // stopCmd represents the stop command
var stopCmd = &cobra.Command{
</s> add // StopCmd represents the stop command
var StopCmd = &cobra.Command{ </s> remove // passwordCmd represents the password command
var passwordCmd = &cobra.Command{
</s> add // PasswordCmd represents the password command
var PasswordCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/lang.go |
RootCmd.AddCommand(LangCmd) | <mask> },
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(langCmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(versionCmd)
</s> add RootCmd.AddCommand(VersionCmd) </s> remove rootCmd.AddCommand(restartCmd)
</s> add RootCmd.AddCommand(RestartCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(serverCmd)
</s> add RootCmd.AddCommand(ServerCmd) </s> remove rootCmd.AddCommand(cancel2FACmd)
</s> add RootCmd.AddCommand(Cancel2FACmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/lang.go |
// RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ | <mask> import (
<mask> "github.com/spf13/cobra"
<mask> )
<mask>
<mask> // restartCmd represents the restart command
<mask> var restartCmd = &cobra.Command{
<mask> Use: "restart",
<mask> Short: "Restart alist server by daemon/pid file",
<mask> Run: func(cmd *cobra.Command, args []string) {
<mask> stop()
<mask> start()
</s> feat: export all cmd (#2746) </s> remove // stopCmd represents the stop command
var stopCmd = &cobra.Command{
</s> add // StopCmd represents the stop command
var StopCmd = &cobra.Command{ </s> remove // startCmd represents the start command
var startCmd = &cobra.Command{
</s> add // StartCmd represents the start command
var StartCmd = &cobra.Command{ </s> remove // serverCmd represents the server command
var serverCmd = &cobra.Command{
</s> add // ServerCmd represents the server command
var ServerCmd = &cobra.Command{ </s> remove // langCmd represents the lang command
var langCmd = &cobra.Command{
</s> add // LangCmd represents the lang command
var LangCmd = &cobra.Command{ </s> remove // passwordCmd represents the password command
var passwordCmd = &cobra.Command{
</s> add // PasswordCmd represents the password command
var PasswordCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/restart.go |
RootCmd.AddCommand(RestartCmd) | <mask> },
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(restartCmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(versionCmd)
</s> add RootCmd.AddCommand(VersionCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(serverCmd)
</s> add RootCmd.AddCommand(ServerCmd) </s> remove rootCmd.AddCommand(cancel2FACmd)
</s> add RootCmd.AddCommand(Cancel2FACmd) </s> remove rootCmd.AddCommand(langCmd)
</s> add RootCmd.AddCommand(LangCmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/restart.go |
var RootCmd = &cobra.Command{ | <mask> "github.com/alist-org/alist/v3/cmd/flags"
<mask> "github.com/spf13/cobra"
<mask> )
<mask>
<mask> var rootCmd = &cobra.Command{
<mask> Use: "alist",
<mask> Short: "A file list program that supports multiple storage.",
<mask> Long: `A file list program that supports multiple storage,
<mask> built with love by Xhofe and friends in Go/Solid.js.
<mask> Complete documentation is available at https://alist.nn.ci/`,
</s> feat: export all cmd (#2746) </s> remove if err := rootCmd.Execute(); err != nil {
</s> add if err := RootCmd.Execute(); err != nil { </s> remove rootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
rootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
rootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
rootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
rootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory")
</s> add RootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
RootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
RootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
RootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
RootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory") </s> remove // serverCmd represents the server command
var serverCmd = &cobra.Command{
</s> add // ServerCmd represents the server command
var ServerCmd = &cobra.Command{ </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ </s> remove // stopCmd represents the stop command
var stopCmd = &cobra.Command{
</s> add // StopCmd represents the stop command
var StopCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/root.go |
if err := RootCmd.Execute(); err != nil { | <mask> Complete documentation is available at https://alist.nn.ci/`,
<mask> }
<mask>
<mask> func Execute() {
<mask> if err := rootCmd.Execute(); err != nil {
<mask> fmt.Fprintln(os.Stderr, err)
<mask> os.Exit(1)
<mask> }
<mask> }
<mask>
</s> feat: export all cmd (#2746) </s> remove // langCmd represents the lang command
var langCmd = &cobra.Command{
</s> add // LangCmd represents the lang command
var LangCmd = &cobra.Command{ </s> remove var rootCmd = &cobra.Command{
</s> add var RootCmd = &cobra.Command{ </s> remove // cancel2FACmd represents the delete2fa command
var cancel2FACmd = &cobra.Command{
</s> add // Cancel2FACmd represents the delete2fa command
var Cancel2FACmd = &cobra.Command{ </s> remove // serverCmd represents the server command
var serverCmd = &cobra.Command{
</s> add // ServerCmd represents the server command
var ServerCmd = &cobra.Command{ </s> remove rootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
rootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
rootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
rootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
rootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory")
</s> add RootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
RootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
RootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
RootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
RootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/root.go |
RootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
RootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
RootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
RootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
RootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory") | <mask> }
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
<mask> rootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
<mask> rootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
<mask> rootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
<mask> rootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory")
<mask> }
</s> feat: export all cmd (#2746) </s> remove var rootCmd = &cobra.Command{
</s> add var RootCmd = &cobra.Command{ </s> remove if err := rootCmd.Execute(); err != nil {
</s> add if err := RootCmd.Execute(); err != nil { </s> remove // startCmd represents the start command
var startCmd = &cobra.Command{
</s> add // StartCmd represents the start command
var StartCmd = &cobra.Command{ </s> remove rootCmd.AddCommand(startCmd)
</s> add RootCmd.AddCommand(StartCmd) </s> remove // langCmd represents the lang command
var langCmd = &cobra.Command{
</s> add // LangCmd represents the lang command
var LangCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/root.go |
// ServerCmd represents the server command
var ServerCmd = &cobra.Command{ | <mask> log "github.com/sirupsen/logrus"
<mask> "github.com/spf13/cobra"
<mask> )
<mask>
<mask> // serverCmd represents the server command
<mask> var serverCmd = &cobra.Command{
<mask> Use: "server",
<mask> Short: "Start the server at the specified address",
<mask> Long: `Start the server at the specified address
<mask> the address is defined in config file`,
<mask> Run: func(cmd *cobra.Command, args []string) {
</s> feat: export all cmd (#2746) </s> remove // stopCmd represents the stop command
var stopCmd = &cobra.Command{
</s> add // StopCmd represents the stop command
var StopCmd = &cobra.Command{ </s> remove // startCmd represents the start command
var startCmd = &cobra.Command{
</s> add // StartCmd represents the start command
var StartCmd = &cobra.Command{ </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ </s> remove var rootCmd = &cobra.Command{
</s> add var RootCmd = &cobra.Command{ </s> remove // passwordCmd represents the password command
var passwordCmd = &cobra.Command{
</s> add // PasswordCmd represents the password command
var PasswordCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/server.go |
RootCmd.AddCommand(ServerCmd) | <mask> },
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(serverCmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(versionCmd)
</s> add RootCmd.AddCommand(VersionCmd) </s> remove rootCmd.AddCommand(restartCmd)
</s> add RootCmd.AddCommand(RestartCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(cancel2FACmd)
</s> add RootCmd.AddCommand(Cancel2FACmd) </s> remove rootCmd.AddCommand(langCmd)
</s> add RootCmd.AddCommand(LangCmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/server.go |
ServerCmd.Run(cmd, args) | <mask> var (
<mask> cmd *cobra.Command
<mask> args []string
<mask> )
<mask> serverCmd.Run(cmd, args)
<mask> }
</s> feat: export all cmd (#2746) </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ </s> remove if err := rootCmd.Execute(); err != nil {
</s> add if err := RootCmd.Execute(); err != nil { </s> remove rootCmd.AddCommand(startCmd)
</s> add RootCmd.AddCommand(StartCmd) </s> remove // langCmd represents the lang command
var langCmd = &cobra.Command{
</s> add // LangCmd represents the lang command
var LangCmd = &cobra.Command{ </s> remove rootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
rootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
rootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
rootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
rootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory")
</s> add RootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
RootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
RootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
RootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
RootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/server.go |
// StartCmd represents the start command
var StartCmd = &cobra.Command{ | <mask> log "github.com/sirupsen/logrus"
<mask> "github.com/spf13/cobra"
<mask> )
<mask>
<mask> // startCmd represents the start command
<mask> var startCmd = &cobra.Command{
<mask> Use: "start",
<mask> Short: "Silent start alist server with `--force-bin-dir`",
<mask> Run: func(cmd *cobra.Command, args []string) {
<mask> start()
<mask> },
</s> feat: export all cmd (#2746) </s> remove // stopCmd represents the stop command
var stopCmd = &cobra.Command{
</s> add // StopCmd represents the stop command
var StopCmd = &cobra.Command{ </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ </s> remove // serverCmd represents the server command
var serverCmd = &cobra.Command{
</s> add // ServerCmd represents the server command
var ServerCmd = &cobra.Command{ </s> remove // passwordCmd represents the password command
var passwordCmd = &cobra.Command{
</s> add // PasswordCmd represents the password command
var PasswordCmd = &cobra.Command{ </s> remove // cancel2FACmd represents the delete2fa command
var cancel2FACmd = &cobra.Command{
</s> add // Cancel2FACmd represents the delete2fa command
var Cancel2FACmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/start.go |
RootCmd.AddCommand(StartCmd) | <mask> }
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(startCmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(versionCmd)
</s> add RootCmd.AddCommand(VersionCmd) </s> remove rootCmd.AddCommand(restartCmd)
</s> add RootCmd.AddCommand(RestartCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(cancel2FACmd)
</s> add RootCmd.AddCommand(Cancel2FACmd) </s> remove rootCmd.AddCommand(serverCmd)
</s> add RootCmd.AddCommand(ServerCmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/start.go |
// StopCmd represents the stop command
var StopCmd = &cobra.Command{ | <mask> log "github.com/sirupsen/logrus"
<mask> "github.com/spf13/cobra"
<mask> )
<mask>
<mask> // stopCmd represents the stop command
<mask> var stopCmd = &cobra.Command{
<mask> Use: "stop",
<mask> Short: "Stop alist server by daemon/pid file",
<mask> Run: func(cmd *cobra.Command, args []string) {
<mask> stop()
<mask> },
</s> feat: export all cmd (#2746) </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ </s> remove // startCmd represents the start command
var startCmd = &cobra.Command{
</s> add // StartCmd represents the start command
var StartCmd = &cobra.Command{ </s> remove // serverCmd represents the server command
var serverCmd = &cobra.Command{
</s> add // ServerCmd represents the server command
var ServerCmd = &cobra.Command{ </s> remove // langCmd represents the lang command
var langCmd = &cobra.Command{
</s> add // LangCmd represents the lang command
var LangCmd = &cobra.Command{ </s> remove // passwordCmd represents the password command
var passwordCmd = &cobra.Command{
</s> add // PasswordCmd represents the password command
var PasswordCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/stop.go |
RootCmd.AddCommand(StopCmd) | <mask> pid = -1
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(stopCmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(startCmd)
</s> add RootCmd.AddCommand(StartCmd) </s> remove rootCmd.AddCommand(versionCmd)
</s> add RootCmd.AddCommand(VersionCmd) </s> remove rootCmd.AddCommand(restartCmd)
</s> add RootCmd.AddCommand(RestartCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(cancel2FACmd)
</s> add RootCmd.AddCommand(Cancel2FACmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/stop.go |
// VersionCmd represents the version command
var VersionCmd = &cobra.Command{ | <mask> "github.com/alist-org/alist/v3/internal/conf"
<mask> "github.com/spf13/cobra"
<mask> )
<mask>
<mask> // versionCmd represents the version command
<mask> var versionCmd = &cobra.Command{
<mask> Use: "version",
<mask> Short: "Show current version of AList",
<mask> Run: func(cmd *cobra.Command, args []string) {
<mask> fmt.Printf(`Built At: %s
<mask> Go Version: %s
</s> feat: export all cmd (#2746) </s> remove // passwordCmd represents the password command
var passwordCmd = &cobra.Command{
</s> add // PasswordCmd represents the password command
var PasswordCmd = &cobra.Command{ </s> remove // cancel2FACmd represents the delete2fa command
var cancel2FACmd = &cobra.Command{
</s> add // Cancel2FACmd represents the delete2fa command
var Cancel2FACmd = &cobra.Command{ </s> remove // stopCmd represents the stop command
var stopCmd = &cobra.Command{
</s> add // StopCmd represents the stop command
var StopCmd = &cobra.Command{ </s> remove // startCmd represents the start command
var startCmd = &cobra.Command{
</s> add // StartCmd represents the start command
var StartCmd = &cobra.Command{ </s> remove // restartCmd represents the restart command
var restartCmd = &cobra.Command{
</s> add // RestartCmd represents the restart command
var RestartCmd = &cobra.Command{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/version.go |
RootCmd.AddCommand(VersionCmd) | <mask> },
<mask> }
<mask>
<mask> func init() {
<mask> rootCmd.AddCommand(versionCmd)
<mask>
<mask> // Here you will define your flags and configuration settings.
<mask>
<mask> // Cobra supports Persistent Flags which will work for this command
<mask> // and all subcommands, e.g.:
</s> feat: export all cmd (#2746) </s> remove rootCmd.AddCommand(restartCmd)
</s> add RootCmd.AddCommand(RestartCmd) </s> remove rootCmd.AddCommand(passwordCmd)
</s> add RootCmd.AddCommand(PasswordCmd) </s> remove rootCmd.AddCommand(serverCmd)
</s> add RootCmd.AddCommand(ServerCmd) </s> remove rootCmd.AddCommand(cancel2FACmd)
</s> add RootCmd.AddCommand(Cancel2FACmd) </s> remove rootCmd.AddCommand(langCmd)
</s> add RootCmd.AddCommand(LangCmd) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0ae3fc608b27fe406834df0f300936ed64ef80fc | cmd/version.go |
UseVideoUrl: x.UseVideoUrl, | <mask> ClientVersion: x.ClientVersion,
<mask> PackageName: x.PackageName,
<mask> UserAgent: x.UserAgent,
<mask> DownloadUserAgent: x.DownloadUserAgent,
<mask> },
<mask> }
<mask>
<mask> if x.CaptchaToken != "" {
<mask> x.SetCaptchaToken(x.CaptchaToken)
</s> feat: Add thunderExpert priority video url switch </s> remove //Links struct{} `json:"links"`
Phase string `json:"phase"`
</s> add Links map[string]Link `json:"links"`
Phase string `json:"phase"` | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/driver.go |
x.XunLeiCommon.UseVideoUrl = x.UseVideoUrl | <mask> }
<mask> x.XunLeiCommon.UserAgent = x.UserAgent
<mask> x.XunLeiCommon.DownloadUserAgent = x.DownloadUserAgent
<mask> }
<mask> return nil
<mask> }
<mask>
<mask> func (x *ThunderExpert) Drop(ctx context.Context) error {
<mask> return nil
</s> feat: Add thunderExpert priority video url switch </s> remove } `json:"medias"` */
</s> add } `json:"medias"` | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/driver.go |
if xc.UseVideoUrl {
for _, media := range lFile.Medias {
if media.Link.URL != "" {
link.URL = media.Link.URL
break
}
}
}
| <mask> },
<mask> }
<mask>
<mask> /*
<mask> strs := regexp.MustCompile(`e=([0-9]*)`).FindStringSubmatch(lFile.WebContentLink)
<mask> if len(strs) == 2 {
<mask> timestamp, err := strconv.ParseInt(strs[1], 10, 64)
<mask> if err == nil {
</s> feat: Add thunderExpert priority video url switch </s> remove /* Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
//Link interface{} `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"`
</s> add Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
Link Link `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"` | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/driver.go |
type Link struct {
URL string `json:"url"`
Token string `json:"token"`
Expire time.Time `json:"expire"`
Type string `json:"type"`
}
| <mask> }
<mask>
<mask> type Files struct {
<mask> Kind string `json:"kind"`
<mask> ID string `json:"id"`
<mask> ParentID string `json:"parent_id"`
<mask> Name string `json:"name"`
</s> feat: Add thunderExpert priority video url switch </s> remove //Links struct{} `json:"links"`
Phase string `json:"phase"`
</s> add Links map[string]Link `json:"links"`
Phase string `json:"phase"` </s> remove /* Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
//Link interface{} `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"`
</s> add Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
Link Link `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"` </s> remove } `json:"medias"` */
</s> add } `json:"medias"` | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/types.go |
Links map[string]Link `json:"links"`
Phase string `json:"phase"` | <mask> IconLink string `json:"icon_link"`
<mask> ThumbnailLink string `json:"thumbnail_link"`
<mask> //Md5Checksum string `json:"md5_checksum"`
<mask> //Hash string `json:"hash"`
<mask> //Links struct{} `json:"links"`
<mask> Phase string `json:"phase"`
<mask> Audit struct {
<mask> Status string `json:"status"`
<mask> Message string `json:"message"`
<mask> Title string `json:"title"`
<mask> } `json:"audit"`
</s> feat: Add thunderExpert priority video url switch </s> remove /* Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
//Link interface{} `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"`
</s> add Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
Link Link `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"` </s> remove } `json:"medias"` */
</s> add } `json:"medias"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/types.go |
Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
Link Link `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"` | <mask> Status string `json:"status"`
<mask> Message string `json:"message"`
<mask> Title string `json:"title"`
<mask> } `json:"audit"`
<mask> /* Medias []struct {
<mask> Category string `json:"category"`
<mask> IconLink string `json:"icon_link"`
<mask> IsDefault bool `json:"is_default"`
<mask> IsOrigin bool `json:"is_origin"`
<mask> IsVisible bool `json:"is_visible"`
<mask> //Link interface{} `json:"link"`
<mask> MediaID string `json:"media_id"`
<mask> MediaName string `json:"media_name"`
<mask> NeedMoreQuota bool `json:"need_more_quota"`
<mask> Priority int `json:"priority"`
<mask> RedirectLink string `json:"redirect_link"`
<mask> ResolutionName string `json:"resolution_name"`
<mask> Video struct {
<mask> AudioCodec string `json:"audio_codec"`
<mask> BitRate int `json:"bit_rate"`
<mask> Duration int `json:"duration"`
<mask> FrameRate int `json:"frame_rate"`
</s> feat: Add thunderExpert priority video url switch </s> remove //Links struct{} `json:"links"`
Phase string `json:"phase"`
</s> add Links map[string]Link `json:"links"`
Phase string `json:"phase"` </s> remove } `json:"medias"` */
</s> add } `json:"medias"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/types.go |
} `json:"medias"` | <mask> VideoType string `json:"video_type"`
<mask> Width int `json:"width"`
<mask> } `json:"video"`
<mask> VipTypes []string `json:"vip_types"`
<mask> } `json:"medias"` */
<mask> Trashed bool `json:"trashed"`
<mask> DeleteTime string `json:"delete_time"`
<mask> OriginalURL string `json:"original_url"`
<mask> //Params struct{} `json:"params"`
<mask> //OriginalFileIndex int `json:"original_file_index"`
</s> feat: Add thunderExpert priority video url switch </s> remove /* Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
//Link interface{} `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"`
</s> add Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
Link Link `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"` </s> remove //Links struct{} `json:"links"`
Phase string `json:"phase"`
</s> add Links map[string]Link `json:"links"`
Phase string `json:"phase"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/types.go |
UseVideoUrl bool | <mask> ClientVersion string
<mask> PackageName string
<mask> UserAgent string
<mask> DownloadUserAgent string
<mask> }
<mask>
<mask> func (c *Common) SetCaptchaToken(captchaToken string) {
<mask> c.captchaToken = captchaToken
<mask> }
</s> feat: Add thunderExpert priority video url switch </s> remove //Links struct{} `json:"links"`
Phase string `json:"phase"`
</s> add Links map[string]Link `json:"links"`
Phase string `json:"phase"` </s> remove /* Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
//Link interface{} `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"`
</s> add Medias []struct {
Category string `json:"category"`
IconLink string `json:"icon_link"`
IsDefault bool `json:"is_default"`
IsOrigin bool `json:"is_origin"`
IsVisible bool `json:"is_visible"`
Link Link `json:"link"`
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
NeedMoreQuota bool `json:"need_more_quota"`
Priority int `json:"priority"`
RedirectLink string `json:"redirect_link"`
ResolutionName string `json:"resolution_name"` </s> remove } `json:"medias"` */
</s> add } `json:"medias"` | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d012f85cb101165b37689f3d0eba7fa7ee7e579 | drivers/thunder/util.go |
"io"
"net/http" | <mask> import (
<mask> "context"
<mask> "errors"
<mask> "path/filepath"
<mask> "strconv"
<mask> "strings"
<mask> "time"
</s> feat(smb): support range header (close #3192) </s> remove }, nil
</s> add }
if args.Header.Get("Range") != "" {
r, err := http_range.ParseRange(args.Header.Get("Range"), file.GetSize())
if err == nil && len(r) > 0 {
_, err := remoteFile.Seek(r[0].Start, io.SeekStart)
if err == nil {
link.Data = utils.NewLimitReadCloser(remoteFile, func() error {
return remoteFile.Close()
}, r[0].Length)
link.Status = 206
link.Header = http.Header{
"Content-Range": []string{r[0].ContentRange(file.GetSize())},
"Content-Length": []string{strconv.FormatInt(r[0].Length, 10)},
}
}
}
}
d.updateLastConnTime()
return link, nil </s> remove d.updateLastConnTime()
return &model.Link{
</s> add link := &model.Link{ | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d07d818027b8736028f8d9f14a399bd1c95fb45 | drivers/smb/driver.go |
"strconv" | <mask> "errors"
<mask> "io"
<mask> "net/http"
<mask> "path/filepath"
<mask> "strings"
<mask> "time"
<mask>
<mask> "github.com/alist-org/alist/v3/internal/driver"
<mask> "github.com/alist-org/alist/v3/internal/model"
<mask> "github.com/alist-org/alist/v3/pkg/http_range"
</s> feat(smb): support range header (close #3192) </s> remove }, nil
</s> add }
if args.Header.Get("Range") != "" {
r, err := http_range.ParseRange(args.Header.Get("Range"), file.GetSize())
if err == nil && len(r) > 0 {
_, err := remoteFile.Seek(r[0].Start, io.SeekStart)
if err == nil {
link.Data = utils.NewLimitReadCloser(remoteFile, func() error {
return remoteFile.Close()
}, r[0].Length)
link.Status = 206
link.Header = http.Header{
"Content-Range": []string{r[0].ContentRange(file.GetSize())},
"Content-Length": []string{strconv.FormatInt(r[0].Length, 10)},
}
}
}
}
d.updateLastConnTime()
return link, nil </s> remove d.updateLastConnTime()
return &model.Link{
</s> add link := &model.Link{ | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d07d818027b8736028f8d9f14a399bd1c95fb45 | drivers/smb/driver.go |
"github.com/alist-org/alist/v3/pkg/http_range" | <mask>
<mask> "github.com/alist-org/alist/v3/internal/driver"
<mask> "github.com/alist-org/alist/v3/internal/model"
<mask> "github.com/alist-org/alist/v3/pkg/utils"
<mask>
<mask> "github.com/hirochachacha/go-smb2"
<mask> )
</s> feat(smb): support range header (close #3192) </s> remove }, nil
</s> add }
if args.Header.Get("Range") != "" {
r, err := http_range.ParseRange(args.Header.Get("Range"), file.GetSize())
if err == nil && len(r) > 0 {
_, err := remoteFile.Seek(r[0].Start, io.SeekStart)
if err == nil {
link.Data = utils.NewLimitReadCloser(remoteFile, func() error {
return remoteFile.Close()
}, r[0].Length)
link.Status = 206
link.Header = http.Header{
"Content-Range": []string{r[0].ContentRange(file.GetSize())},
"Content-Length": []string{strconv.FormatInt(r[0].Length, 10)},
}
}
}
}
d.updateLastConnTime()
return link, nil </s> remove d.updateLastConnTime()
return &model.Link{
</s> add link := &model.Link{ | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d07d818027b8736028f8d9f14a399bd1c95fb45 | drivers/smb/driver.go |
link := &model.Link{ | <mask> if err != nil {
<mask> d.cleanLastConnTime()
<mask> return nil, err
<mask> }
<mask> d.updateLastConnTime()
<mask> return &model.Link{
<mask> Data: remoteFile,
<mask> }, nil
<mask> }
<mask>
<mask> func (d *SMB) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
</s> feat(smb): support range header (close #3192) </s> remove }, nil
</s> add }
if args.Header.Get("Range") != "" {
r, err := http_range.ParseRange(args.Header.Get("Range"), file.GetSize())
if err == nil && len(r) > 0 {
_, err := remoteFile.Seek(r[0].Start, io.SeekStart)
if err == nil {
link.Data = utils.NewLimitReadCloser(remoteFile, func() error {
return remoteFile.Close()
}, r[0].Length)
link.Status = 206
link.Header = http.Header{
"Content-Range": []string{r[0].ContentRange(file.GetSize())},
"Content-Length": []string{strconv.FormatInt(r[0].Length, 10)},
}
}
}
}
d.updateLastConnTime()
return link, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d07d818027b8736028f8d9f14a399bd1c95fb45 | drivers/smb/driver.go |
}
if args.Header.Get("Range") != "" {
r, err := http_range.ParseRange(args.Header.Get("Range"), file.GetSize())
if err == nil && len(r) > 0 {
_, err := remoteFile.Seek(r[0].Start, io.SeekStart)
if err == nil {
link.Data = utils.NewLimitReadCloser(remoteFile, func() error {
return remoteFile.Close()
}, r[0].Length)
link.Status = 206
link.Header = http.Header{
"Content-Range": []string{r[0].ContentRange(file.GetSize())},
"Content-Length": []string{strconv.FormatInt(r[0].Length, 10)},
}
}
}
}
d.updateLastConnTime()
return link, nil | <mask> }
<mask> d.updateLastConnTime()
<mask> return &model.Link{
<mask> Data: remoteFile,
<mask> }, nil
<mask> }
<mask>
<mask> func (d *SMB) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
<mask> if err := d.checkConn(); err != nil {
<mask> return err
</s> feat(smb): support range header (close #3192) </s> remove d.updateLastConnTime()
return &model.Link{
</s> add link := &model.Link{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0d07d818027b8736028f8d9f14a399bd1c95fb45 | drivers/smb/driver.go |
github.com/inconshreveable/mousetrap v1.0.0 // indirect | <mask> github.com/go-playground/universal-translator v0.18.0 // indirect
<mask> github.com/go-playground/validator/v10 v10.11.0 // indirect
<mask> github.com/go-sql-driver/mysql v1.6.0 // indirect
<mask> github.com/goccy/go-json v0.9.7 // indirect
<mask> github.com/jackc/chunkreader/v2 v2.0.1 // indirect
<mask> github.com/jackc/pgconn v1.12.1 // indirect
<mask> github.com/jackc/pgio v1.0.0 // indirect
<mask> github.com/jackc/pgpassfile v1.0.0 // indirect
<mask> github.com/jackc/pgproto3/v2 v2.3.0 // indirect
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | go.mod |
github.com/spf13/cobra v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect | <mask> github.com/modern-go/reflect2 v1.0.2 // indirect
<mask> github.com/pelletier/go-toml/v2 v2.0.1 // indirect
<mask> github.com/ugorji/go/codec v1.2.7 // indirect
<mask> golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
<mask> golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect
<mask> golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | go.mod |
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | <mask> github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
<mask> github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
<mask> github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
<mask> github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
<mask> github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
<mask> github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<mask> github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
<mask> github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | go.sum |
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | <mask> github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
<mask> github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
<mask> github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
<mask> github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
<mask> github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
<mask> github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
<mask> github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
<mask> github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
</s> feat: use cobra and add some command </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | go.sum |
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | <mask> github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
<mask> github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
<mask> github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
<mask> github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
<mask> github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
<mask> github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
<mask> github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | go.sum |
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | <mask> github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
<mask> github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
<mask> github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
<mask> github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | go.sum |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> "io/ioutil"
<mask> "os"
<mask> "path/filepath"
<mask>
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/conf"
<mask> "github.com/alist-org/alist/v3/pkg/utils"
<mask> "github.com/caarlos0/env/v6"
<mask> log "github.com/sirupsen/logrus"
<mask> )
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Infof("reading config file: %s", flags.Config)
if !utils.Exists(flags.Config) { | <mask> log "github.com/sirupsen/logrus"
<mask> )
<mask>
<mask> func InitConfig() {
<mask> log.Infof("reading config file: %s", args.Config)
<mask> if !utils.Exists(args.Config) {
<mask> log.Infof("config file not exists, creating default config file")
<mask> _, err := utils.CreateNestedFile(args.Config)
<mask> if err != nil {
<mask> log.Fatalf("failed to create config file: %+v", err)
<mask> }
</s> feat: use cobra and add some command </s> remove _, err := utils.CreateNestedFile(args.Config)
</s> add _, err := utils.CreateNestedFile(flags.Config) </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
_, err := utils.CreateNestedFile(flags.Config) | <mask> func InitConfig() {
<mask> log.Infof("reading config file: %s", args.Config)
<mask> if !utils.Exists(args.Config) {
<mask> log.Infof("config file not exists, creating default config file")
<mask> _, err := utils.CreateNestedFile(args.Config)
<mask> if err != nil {
<mask> log.Fatalf("failed to create config file: %+v", err)
<mask> }
<mask> conf.Conf = conf.DefaultConfig()
<mask> if !utils.WriteToJson(args.Config, conf.Conf) {
</s> feat: use cobra and add some command </s> remove log.Infof("reading config file: %s", args.Config)
if !utils.Exists(args.Config) {
</s> add log.Infof("reading config file: %s", flags.Config)
if !utils.Exists(flags.Config) { </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
if !utils.WriteToJson(flags.Config, conf.Conf) { | <mask> if err != nil {
<mask> log.Fatalf("failed to create config file: %+v", err)
<mask> }
<mask> conf.Conf = conf.DefaultConfig()
<mask> if !utils.WriteToJson(args.Config, conf.Conf) {
<mask> log.Fatalf("failed to create default config file")
<mask> }
<mask> } else {
<mask> configBytes, err := ioutil.ReadFile(args.Config)
<mask> if err != nil {
</s> feat: use cobra and add some command </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove _, err := utils.CreateNestedFile(args.Config)
</s> add _, err := utils.CreateNestedFile(flags.Config) </s> remove log.Infof("reading config file: %s", args.Config)
if !utils.Exists(args.Config) {
</s> add log.Infof("reading config file: %s", flags.Config)
if !utils.Exists(flags.Config) { </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
configBytes, err := ioutil.ReadFile(flags.Config) | <mask> if !utils.WriteToJson(args.Config, conf.Conf) {
<mask> log.Fatalf("failed to create default config file")
<mask> }
<mask> } else {
<mask> configBytes, err := ioutil.ReadFile(args.Config)
<mask> if err != nil {
<mask> log.Fatalf("reading config file error:%s", err.Error())
<mask> }
<mask> conf.Conf = conf.DefaultConfig()
<mask> err = utils.Json.Unmarshal(configBytes, conf.Conf)
</s> feat: use cobra and add some command </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove _, err := utils.CreateNestedFile(args.Config)
</s> add _, err := utils.CreateNestedFile(flags.Config) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Infof("reading config file: %s", args.Config)
if !utils.Exists(args.Config) {
</s> add log.Infof("reading config file: %s", flags.Config)
if !utils.Exists(flags.Config) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Fatalf("reading config file error: %+v", err) | <mask> }
<mask> } else {
<mask> configBytes, err := ioutil.ReadFile(args.Config)
<mask> if err != nil {
<mask> log.Fatalf("reading config file error:%s", err.Error())
<mask> }
<mask> conf.Conf = conf.DefaultConfig()
<mask> err = utils.Json.Unmarshal(configBytes, conf.Conf)
<mask> if err != nil {
<mask> log.Fatalf("load config error: %s", err.Error())
</s> feat: use cobra and add some command </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Fatalf("load config error: %+v", err) | <mask> }
<mask> conf.Conf = conf.DefaultConfig()
<mask> err = utils.Json.Unmarshal(configBytes, conf.Conf)
<mask> if err != nil {
<mask> log.Fatalf("load config error: %s", err.Error())
<mask> }
<mask> log.Debugf("config:%+v", conf.Conf)
<mask> // update config.json struct
<mask> confBody, err := utils.Json.MarshalIndent(conf.Conf, "", " ")
<mask> if err != nil {
</s> feat: use cobra and add some command </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove log.Fatalf("marshal config error:%s", err.Error())
</s> add log.Fatalf("marshal config error: %+v", err) </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
<mask> err = utils.Json.Unmarshal(configBytes, conf.Conf)
<mask> if err != nil {
<mask> log.Fatalf("load config error: %s", err.Error())
<mask> }
<mask> log.Debugf("config:%+v", conf.Conf)
<mask> // update config.json struct
<mask> confBody, err := utils.Json.MarshalIndent(conf.Conf, "", " ")
<mask> if err != nil {
<mask> log.Fatalf("marshal config error:%s", err.Error())
<mask> }
</s> feat: use cobra and add some command </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Fatalf("marshal config error:%s", err.Error())
</s> add log.Fatalf("marshal config error: %+v", err) </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go | |
log.Fatalf("marshal config error: %+v", err) | <mask> log.Debugf("config:%+v", conf.Conf)
<mask> // update config.json struct
<mask> confBody, err := utils.Json.MarshalIndent(conf.Conf, "", " ")
<mask> if err != nil {
<mask> log.Fatalf("marshal config error:%s", err.Error())
<mask> }
<mask> err = ioutil.WriteFile(args.Config, confBody, 0777)
<mask> if err != nil {
<mask> log.Fatalf("update config struct error: %s", err.Error())
<mask> }
</s> feat: use cobra and add some command </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
err = ioutil.WriteFile(flags.Config, confBody, 0777) | <mask> confBody, err := utils.Json.MarshalIndent(conf.Conf, "", " ")
<mask> if err != nil {
<mask> log.Fatalf("marshal config error:%s", err.Error())
<mask> }
<mask> err = ioutil.WriteFile(args.Config, confBody, 0777)
<mask> if err != nil {
<mask> log.Fatalf("update config struct error: %s", err.Error())
<mask> }
<mask> }
<mask> if !conf.Conf.Force {
</s> feat: use cobra and add some command </s> remove log.Fatalf("marshal config error:%s", err.Error())
</s> add log.Fatalf("marshal config error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Fatalf("update config struct error: %+v", err) | <mask> log.Fatalf("marshal config error:%s", err.Error())
<mask> }
<mask> err = ioutil.WriteFile(args.Config, confBody, 0777)
<mask> if err != nil {
<mask> log.Fatalf("update config struct error: %s", err.Error())
<mask> }
<mask> }
<mask> if !conf.Conf.Force {
<mask> confFromEnv()
<mask> }
</s> feat: use cobra and add some command </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) </s> remove log.Fatalf("marshal config error:%s", err.Error())
</s> add log.Fatalf("marshal config error: %+v", err) </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Fatalf("get abs path error: %+v", err) | <mask> var err error
<mask> if !filepath.IsAbs(conf.Conf.TempDir) {
<mask> absPath, err = filepath.Abs(conf.Conf.TempDir)
<mask> if err != nil {
<mask> log.Fatalf("get abs path error: %s", err.Error())
<mask> }
<mask> }
<mask> conf.Conf.TempDir = absPath
<mask> err = os.RemoveAll(filepath.Join(conf.Conf.TempDir))
<mask> if err != nil {
</s> feat: use cobra and add some command </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Fatalf("create temp dir error: %+v", err) | <mask> log.Errorln("failed delete temp file:", err)
<mask> }
<mask> err = os.MkdirAll(conf.Conf.TempDir, 0700)
<mask> if err != nil {
<mask> log.Fatalf("create temp dir error: %s", err.Error())
<mask> }
<mask> log.Debugf("config: %+v", conf.Conf)
<mask> }
<mask>
<mask> func confFromEnv() {
</s> feat: use cobra and add some command </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Fatalf("marshal config error:%s", err.Error())
</s> add log.Fatalf("marshal config error: %+v", err) </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
if flags.NoPrefix { | <mask> }
<mask>
<mask> func confFromEnv() {
<mask> prefix := "ALIST_"
<mask> if args.NoPrefix {
<mask> prefix = ""
<mask> }
<mask> log.Infof("load config from env with prefix: %s", prefix)
<mask> if err := env.Parse(conf.Conf, env.Options{
<mask> Prefix: prefix,
</s> feat: use cobra and add some command </s> remove log.Fatalf("load config from env error: %s", err.Error())
</s> add log.Fatalf("load config from env error: %+v", err) </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) </s> remove log.Fatalf("create temp dir error: %s", err.Error())
</s> add log.Fatalf("create temp dir error: %+v", err) </s> remove _, err := utils.CreateNestedFile(args.Config)
</s> add _, err := utils.CreateNestedFile(flags.Config) </s> remove err = ioutil.WriteFile(args.Config, confBody, 0777)
</s> add err = ioutil.WriteFile(flags.Config, confBody, 0777) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
log.Fatalf("load config from env error: %+v", err) | <mask> log.Infof("load config from env with prefix: %s", prefix)
<mask> if err := env.Parse(conf.Conf, env.Options{
<mask> Prefix: prefix,
<mask> }); err != nil {
<mask> log.Fatalf("load config from env error: %s", err.Error())
<mask> }
<mask> }
</s> feat: use cobra and add some command </s> remove if args.NoPrefix {
</s> add if flags.NoPrefix { </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove log.Fatalf("update config struct error: %s", err.Error())
</s> add log.Fatalf("update config struct error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/config.go |
import "github.com/alist-org/alist/v3/cmd/flags" | <mask> package data
<mask>
<mask> import "github.com/alist-org/alist/v3/cmd/args"
<mask>
<mask> func InitData() {
<mask> initUser()
<mask> initSettings()
<mask> if args.Dev {
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/data.go |
if flags.Dev { | <mask>
<mask> func InitData() {
<mask> initUser()
<mask> initSettings()
<mask> if args.Dev {
<mask> initDevData()
<mask> initDevDo()
<mask> }
<mask> }
</s> feat: use cobra and add some command </s> remove import "github.com/alist-org/alist/v3/cmd/args"
</s> add import "github.com/alist-org/alist/v3/cmd/flags" </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/data.go |
"github.com/alist-org/alist/v3/cmd/flags" | <mask>
<mask> import (
<mask> "context"
<mask>
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/db"
<mask> "github.com/alist-org/alist/v3/internal/message"
<mask> "github.com/alist-org/alist/v3/internal/model"
<mask> "github.com/alist-org/alist/v3/internal/operations"
<mask> log "github.com/sirupsen/logrus"
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/dev.go |
if flags.Dev { | <mask> }
<mask> }
<mask>
<mask> func initDevDo() {
<mask> if args.Dev {
<mask> go func() {
<mask> err := message.GetMessenger().WaitSend(map[string]string{
<mask> "type": "dev",
<mask> "msg": "dev mode",
<mask> }, 10)
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/dev.go |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> package data
<mask>
<mask> import (
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/conf"
<mask> "github.com/alist-org/alist/v3/internal/db"
<mask> "github.com/alist-org/alist/v3/internal/model"
<mask> "github.com/alist-org/alist/v3/pkg/utils/random"
<mask> "github.com/pkg/errors"
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove import "github.com/alist-org/alist/v3/cmd/args"
</s> add import "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/setting.go |
if flags.Dev { | <mask> }
<mask>
<mask> func initialSettings() {
<mask> var token string
<mask> if args.Dev {
<mask> token = "dev_token"
<mask> } else {
<mask> token = random.Token()
<mask> }
<mask> initialSettingItems = []model.SettingItem{
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/setting.go |
if flags.Dev { | <mask> {Key: conf.Aria2Secret, Value: "", Type: conf.TypeString, Group: model.ARIA2, Flag: model.PRIVATE},
<mask> // single settings
<mask> {Key: conf.Token, Value: token, Type: conf.TypeString, Group: model.SINGLE, Flag: model.PRIVATE},
<mask> }
<mask> if args.Dev {
<mask> initialSettingItems = append(initialSettingItems, model.SettingItem{Key: "test_deprecated", Value: "test_value", Type: conf.TypeString, Flag: model.DEPRECATED})
<mask> }
<mask> }
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove log.Debugf("config:%+v", conf.Conf)
</s> add </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove log.Fatalf("load config error: %s", err.Error())
</s> add log.Fatalf("load config error: %+v", err) </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/setting.go |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> package data
<mask>
<mask> import (
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/db"
<mask> "github.com/alist-org/alist/v3/internal/model"
<mask> "github.com/alist-org/alist/v3/pkg/utils/random"
<mask> "github.com/pkg/errors"
<mask> log "github.com/sirupsen/logrus"
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove import "github.com/alist-org/alist/v3/cmd/args"
</s> add import "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/user.go |
if flags.Dev { | <mask>
<mask> func initUser() {
<mask> admin, err := db.GetAdmin()
<mask> adminPassword := random.String(8)
<mask> if args.Dev {
<mask> adminPassword = "admin"
<mask> }
<mask> if err != nil {
<mask> if errors.Is(err, gorm.ErrRecordNotFound) {
<mask> admin = &model.User{
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove import "github.com/alist-org/alist/v3/cmd/args"
</s> add import "github.com/alist-org/alist/v3/cmd/flags" </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/user.go |
} else {
log.Infof("Successfully created the administrator user and the initial password is: %s", admin.Password) | <mask> BasePath: "/",
<mask> }
<mask> if err := db.CreateUser(admin); err != nil {
<mask> panic(err)
<mask> }
<mask> } else {
<mask> panic(err)
<mask> }
<mask> }
<mask> guest, err := db.GetGuest()
</s> feat: use cobra and add some command </s> remove log.Infof("admin password: %+v", admin.Password)
</s> add </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove configBytes, err := ioutil.ReadFile(args.Config)
</s> add configBytes, err := ioutil.ReadFile(flags.Config) </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/user.go |
<mask> } else {
<mask> panic(err)
<mask> }
<mask> }
<mask> log.Infof("admin password: %+v", admin.Password)
<mask> }
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove log.Fatalf("reading config file error:%s", err.Error())
</s> add log.Fatalf("reading config file error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/data/user.go | |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> stdlog "log"
<mask> "strings"
<mask> "time"
<mask>
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/conf"
<mask> "github.com/alist-org/alist/v3/internal/db"
<mask> log "github.com/sirupsen/logrus"
<mask> "gorm.io/driver/mysql"
<mask> "gorm.io/driver/postgres"
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/db.go |
if flags.Dev { | <mask> Logger: newLogger,
<mask> }
<mask> var dB *gorm.DB
<mask> var err error
<mask> if args.Dev {
<mask> dB, err = gorm.Open(sqlite.Open("file::memory:?cache=shared"), gormConfig)
<mask> } else {
<mask> database := conf.Conf.Database
<mask> switch database.Type {
<mask> case "sqlite3":
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/db.go |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> import (
<mask> "log"
<mask> "time"
<mask>
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/conf"
<mask> rotatelogs "github.com/lestrrat-go/file-rotatelogs"
<mask> "github.com/sirupsen/logrus"
<mask> )
<mask>
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/log.go |
if flags.Debug || flags.Dev { | <mask> }
<mask>
<mask> func Log() {
<mask> log.SetOutput(logrus.StandardLogger().Out)
<mask> if args.Debug || args.Dev {
<mask> logrus.SetLevel(logrus.DebugLevel)
<mask> logrus.SetReportCaller(true)
<mask> } else {
<mask> logrus.SetLevel(logrus.InfoLevel)
<mask> logrus.SetReportCaller(false)
</s> feat: use cobra and add some command </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | internal/bootstrap/log.go |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> package common
<mask>
<mask> import (
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/gin-gonic/gin"
<mask> log "github.com/sirupsen/logrus"
<mask> )
<mask>
<mask> // ErrorResp is used to return error response
</s> feat: use cobra and add some command </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | server/common/common.go |
if flags.Debug || flags.Dev { | <mask> // ErrorResp is used to return error response
<mask> // @param l: if true, log error
<mask> func ErrorResp(c *gin.Context, err error, code int, l ...bool) {
<mask> if len(l) > 0 && l[0] {
<mask> if args.Debug || args.Dev {
<mask> log.Errorf("%+v", err)
<mask> } else {
<mask> log.Errorf("%v", err)
<mask> }
<mask> }
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if !utils.WriteToJson(args.Config, conf.Conf) {
</s> add if !utils.WriteToJson(flags.Config, conf.Conf) { </s> remove log.Fatalf("get abs path error: %s", err.Error())
</s> add log.Fatalf("get abs path error: %+v", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | server/common/common.go |
"github.com/alist-org/alist/v3/cmd/flags" | <mask> package server
<mask>
<mask> import (
<mask> "github.com/alist-org/alist/v3/cmd/args"
<mask> "github.com/alist-org/alist/v3/internal/conf"
<mask> "github.com/alist-org/alist/v3/internal/message"
<mask> "github.com/alist-org/alist/v3/server/common"
<mask> "github.com/alist-org/alist/v3/server/handles"
<mask> "github.com/alist-org/alist/v3/server/middlewares"
</s> feat: use cobra and add some command </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" </s> remove "github.com/alist-org/alist/v3/cmd/args"
</s> add "github.com/alist-org/alist/v3/cmd/flags" | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | server/router.go |
if flags.Dev { | <mask> public.Any("/settings", handles.PublicSettings)
<mask>
<mask> fs(auth.Group("/fs"))
<mask> admin(auth.Group("/admin", middlewares.AuthAdmin))
<mask> if args.Dev {
<mask> dev(r.Group("/dev"))
<mask> }
<mask> }
<mask>
<mask> func admin(g *gin.RouterGroup) {
</s> feat: use cobra and add some command </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Debug || args.Dev {
</s> add if flags.Debug || flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { </s> remove if args.Dev {
</s> add if flags.Dev { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0df3473337771b2a0228c4b6b0212ddb6c00d5bf | server/router.go |
{
Key: "customize style",
Value: "",
Type: "text",
Description: "customize style, don't need add <style></style>",
},
{
Key: "customize script",
Value: "",
Type: "text",
Description: "customize script, don't need add <script></script>",
}, | <mask> Value: "false",
<mask> Type: "bool",
<mask> Description: "check parent folder password",
<mask> },
<mask> }
<mask> for _, v := range settings {
<mask> _, err := model.GetSettingByKey(v.Key)
<mask> if err == gorm.ErrRecordNotFound {
</s> :sparkles: add customize style / script </s> remove } </s> add </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) </s> remove data, _ = ioutil.ReadAll(index)
</s> add data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) </s> remove var data []byte
</s> add </s> remove CheckParent bool
) </s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | bootstrap/model.go |
<mask> )
<mask>
<mask> // settings
<mask> var (
<mask> CheckParent bool
<mask> ) </s> :sparkles: add customize style / script </s> remove var data []byte
</s> add </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | conf/var.go | |
RawIndexHtml string
IndexHtml string
CheckParent bool
//CustomizeStyle string
//CustomizeScript string
//Favicon string
) | <mask>
<mask> // settings
<mask> var (
<mask> RawIndexHtml string
</s> :sparkles: add customize style / script </s> remove CheckParent bool
) </s> add </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) </s> remove data, _ = ioutil.ReadAll(index)
</s> add data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) | [
"keep",
"keep",
"keep",
"add"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | conf/var.go |
<mask> checkParent, err := GetSettingByKey("check parent folder")
<mask> if err == nil {
<mask> conf.CheckParent = checkParent.Value == "true"
<mask> }
<mask> } </s> :sparkles: add customize style / script </s> remove data, _ = ioutil.ReadAll(index)
</s> add data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) </s> remove var data []byte
</s> add </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | model/setting.go | |
"github.com/Xhofe/alist/conf" | <mask> package server
<mask>
<mask> import (
<mask> "github.com/Xhofe/alist/public"
<mask> "github.com/gin-gonic/gin"
<mask> log "github.com/sirupsen/logrus"
<mask> "io/fs"
</s> :sparkles: add customize style / script </s> remove CheckParent bool
) </s> add </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) </s> remove data, _ = ioutil.ReadAll(index)
</s> add data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) </s> remove var data []byte
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | server/static.go |
<mask> "io/ioutil"
<mask> "net/http"
<mask> )
<mask>
<mask> var data []byte
<mask>
<mask> func init() {
<mask> index, _ := public.Public.Open("index.html")
<mask> data, _ = ioutil.ReadAll(index)
<mask> }
</s> :sparkles: add customize style / script </s> remove data, _ = ioutil.ReadAll(index)
</s> add data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) </s> remove } </s> add </s> remove CheckParent bool
) </s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | server/static.go | |
data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) | <mask> var data []byte
<mask>
<mask> func init() {
<mask> index, _ := public.Public.Open("index.html")
<mask> data, _ = ioutil.ReadAll(index)
<mask> }
<mask>
<mask> func Static(r *gin.Engine) {
<mask> assets, err := fs.Sub(public.Public, "assets")
<mask> if err != nil {
</s> :sparkles: add customize style / script </s> remove var data []byte
</s> add </s> remove } </s> add </s> remove _, _ = c.Writer.Write(data)
</s> add _, _ = c.Writer.WriteString(conf.IndexHtml) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | server/static.go |
_, _ = c.Writer.WriteString(conf.IndexHtml) | <mask> r.StaticFS("/assets/", http.FS(assets))
<mask> r.NoRoute(func(c *gin.Context) {
<mask> c.Status(200)
<mask> c.Header("Content-Type", "text/html")
<mask> _, _ = c.Writer.Write(data)
<mask> c.Writer.Flush()
<mask> })
<mask> }
</s> :sparkles: add customize style / script </s> remove var data []byte
</s> add </s> remove data, _ = ioutil.ReadAll(index)
</s> add data, _ := ioutil.ReadAll(index)
conf.RawIndexHtml = string(data) </s> remove } </s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0dffb9aaa1ec9dda388da8a3d906ec7b5abc04c6 | server/static.go |
<mask> "context"
<mask> "errors"
<mask> "fmt"
<mask> "io"
<mask> "io/ioutil"
<mask> "net/http"
<mask> "os"
<mask> stdpath "path"
<mask> "path/filepath"
<mask> "strconv"
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove "io/ioutil"
</s> add </s> remove "io/ioutil"
</s> add </s> remove ffmpeg "github.com/u2takey/ffmpeg-go"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | drivers/local/driver.go | |
rawFiles, err := readDir(fullPath) | <mask> }
<mask>
<mask> func (d *Local) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
<mask> fullPath := dir.GetPath()
<mask> rawFiles, err := ioutil.ReadDir(fullPath)
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask> var files []model.Obj
<mask> for _, f := range rawFiles {
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.GetName(), url.QueryEscape(file.GetName())))
</s> add filename := file.GetName()
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))) </s> remove all, _ := ioutil.ReadAll(res.Body)
</s> add all, _ := io.ReadAll(res.Body) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | drivers/local/driver.go |
<mask>
<mask> import (
<mask> "bytes"
<mask> "fmt"
<mask> ffmpeg "github.com/u2takey/ffmpeg-go"
<mask> "io/fs"
<mask> "os"
<mask> "path/filepath"
<mask> )
<mask>
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove "io/ioutil"
</s> add </s> remove "io/ioutil"
</s> add </s> remove "io/ioutil"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | drivers/local/util.go | |
"sort"
ffmpeg "github.com/u2takey/ffmpeg-go" | <mask> "os"
<mask> "path/filepath"
<mask> )
<mask>
<mask> func isSymlinkDir(f fs.FileInfo, path string) bool {
<mask> if f.Mode()&os.ModeSymlink == os.ModeSymlink {
<mask> dst, err := os.Readlink(filepath.Join(path, f.Name()))
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove rawFiles, err := ioutil.ReadDir(fullPath)
</s> add rawFiles, err := readDir(fullPath) </s> remove w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.GetName(), url.QueryEscape(file.GetName())))
</s> add filename := file.GetName()
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove ffmpeg "github.com/u2takey/ffmpeg-go"
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | drivers/local/util.go |
<mask> import (
<mask> "context"
<mask> "encoding/base64"
<mask> "errors"
<mask> "io/ioutil"
<mask> "net/url"
<mask> "time"
<mask> )
<mask>
<mask> // Option is a container for specifying Call parameters and returning results
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove "io/ioutil"
</s> add </s> remove "io/ioutil"
</s> add </s> remove ffmpeg "github.com/u2takey/ffmpeg-go"
</s> add </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | pkg/aria2/rpc/client.go | |
"os" | <mask> "context"
<mask> "encoding/base64"
<mask> "errors"
<mask> "net/url"
<mask> "time"
<mask> )
<mask>
<mask> // Option is a container for specifying Call parameters and returning results
<mask> type Option map[string]interface{}
<mask>
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove "io/ioutil"
</s> add </s> remove "io/ioutil"
</s> add </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove "io/ioutil"
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | pkg/aria2/rpc/client.go |
co, err := os.ReadFile(filename) | <mask> // E.g. a file name might be 0a3893293e27ac0490424c06de4d09242215f0a6.torrent.
<mask> // If a file with the same name already exists, it is overwritten!
<mask> // If the file cannot be saved successfully or --rpc-save-upload-metadata is false, the downloads added by this method are not saved by --save-session.
<mask> func (c *client) AddTorrent(filename string, options ...interface{}) (gid string, err error) {
<mask> co, err := ioutil.ReadFile(filename)
<mask> if err != nil {
<mask> return
<mask> }
<mask> file := base64.StdEncoding.EncodeToString(co)
<mask> params := make([]interface{}, 0, 3)
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove rawFiles, err := ioutil.ReadDir(fullPath)
</s> add rawFiles, err := readDir(fullPath) </s> remove w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.GetName(), url.QueryEscape(file.GetName())))
</s> add filename := file.GetName()
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))) </s> remove all, _ := ioutil.ReadAll(res.Body)
</s> add all, _ := io.ReadAll(res.Body) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | pkg/aria2/rpc/client.go |
co, err := os.ReadFile(filename) | <mask> // E.g. a file name might be 0a3893293e27ac0490424c06de4d09242215f0a6.metalink.
<mask> // If a file with the same name already exists, it is overwritten!
<mask> // If the file cannot be saved successfully or --rpc-save-upload-metadata is false, the downloads added by this method are not saved by --save-session.
<mask> func (c *client) AddMetalink(filename string, options ...interface{}) (gid []string, err error) {
<mask> co, err := ioutil.ReadFile(filename)
<mask> if err != nil {
<mask> return
<mask> }
<mask> file := base64.StdEncoding.EncodeToString(co)
<mask> params := make([]interface{}, 0, 2)
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove rawFiles, err := ioutil.ReadDir(fullPath)
</s> add rawFiles, err := readDir(fullPath) </s> remove w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.GetName(), url.QueryEscape(file.GetName())))
</s> add filename := file.GetName()
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))) </s> remove all, _ := ioutil.ReadAll(res.Body)
</s> add all, _ := io.ReadAll(res.Body) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | pkg/aria2/rpc/client.go |
<mask>
<mask> import (
<mask> "fmt"
<mask> "io"
<mask> "io/ioutil"
<mask> "net/http"
<mask> "net/url"
<mask> "os"
<mask> "strconv"
<mask> "strings"
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove "io/ioutil"
</s> add </s> remove "io/ioutil"
</s> add </s> remove ffmpeg "github.com/u2takey/ffmpeg-go"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | server/common/proxy.go | |
filename := file.GetName()
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))) | <mask> fileStat, err := os.Stat(*link.FilePath)
<mask> if err != nil {
<mask> return err
<mask> }
<mask> w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.GetName(), url.QueryEscape(file.GetName())))
<mask> http.ServeContent(w, r, file.GetName(), fileStat.ModTime(), f)
<mask> return nil
<mask> } else {
<mask> req, err := http.NewRequest(r.Method, link.URL, nil)
<mask> if err != nil {
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove rawFiles, err := ioutil.ReadDir(fullPath)
</s> add rawFiles, err := readDir(fullPath) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove all, _ := ioutil.ReadAll(res.Body)
</s> add all, _ := io.ReadAll(res.Body) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | server/common/proxy.go |
all, _ := io.ReadAll(res.Body) | <mask> w.Header()[h] = v
<mask> }
<mask> w.WriteHeader(res.StatusCode)
<mask> if res.StatusCode >= 400 {
<mask> all, _ := ioutil.ReadAll(res.Body)
<mask> msg := string(all)
<mask> log.Debugln(msg)
<mask> return errors.New(msg)
<mask> }
<mask> _, err = io.Copy(w, res.Body)
</s> fix(local): filename with whitespace issue (#3928)
* fix(local): filename whitespace problem
* fix(deps): remove deprecated package io/ioutil
---------
Co-authored-by: XZB <i@1248.ink> </s> remove rawFiles, err := ioutil.ReadDir(fullPath)
</s> add rawFiles, err := readDir(fullPath) </s> remove w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.GetName(), url.QueryEscape(file.GetName())))
</s> add filename := file.GetName()
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) </s> remove co, err := ioutil.ReadFile(filename)
</s> add co, err := os.ReadFile(filename) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0eab31bdf508c1b974063a253193a877648610f5 | server/common/proxy.go |
obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true}) | <mask> return parts[0], parts[1]
<mask> }
<mask>
<mask> func (d *Alias) get(ctx context.Context, path string, dst, sub string) (model.Obj, error) {
<mask> obj, err := fs.Get(ctx, stdpath.Join(dst, sub))
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask> return &model.Object{
<mask> Path: path,
</s> perf(alias): disabled log on fs call (close #4054) </s> remove objs, err := fs.List(ctx, stdpath.Join(dst, sub))
</s> add objs, err := fs.List(ctx, stdpath.Join(dst, sub), &fs.ListArgs{NoLog: true}) </s> remove storage, err := fs.GetStorage(reqPath)
</s> add storage, err := fs.GetStorage(reqPath, &fs.GetStoragesArgs{NoLog: true}) </s> remove func Get(ctx context.Context, path string) (model.Obj, error) {
</s> add type GetArgs struct {
NoLog bool
}
func Get(ctx context.Context, path string, args *GetArgs) (model.Obj, error) { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove func GetStorage(path string) (driver.Driver, error) {
</s> add type GetStoragesArgs struct {
NoLog bool
}
func GetStorage(path string, args *GetStoragesArgs) (driver.Driver, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | drivers/alias/util.go |
objs, err := fs.List(ctx, stdpath.Join(dst, sub), &fs.ListArgs{NoLog: true}) | <mask> }, nil
<mask> }
<mask>
<mask> func (d *Alias) list(ctx context.Context, dst, sub string) ([]model.Obj, error) {
<mask> objs, err := fs.List(ctx, stdpath.Join(dst, sub))
<mask> // the obj must implement the model.SetPath interface
<mask> // return objs, err
<mask> if err != nil {
<mask> return nil, err
<mask> }
</s> perf(alias): disabled log on fs call (close #4054) </s> remove obj, err := fs.Get(ctx, stdpath.Join(dst, sub))
</s> add obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true}) </s> remove storage, err := fs.GetStorage(reqPath)
</s> add storage, err := fs.GetStorage(reqPath, &fs.GetStoragesArgs{NoLog: true}) </s> remove func List(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error) {
res, err := list(ctx, path, refresh...)
</s> add type ListArgs struct {
Refresh bool
NoLog bool
}
func List(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) {
res, err := list(ctx, path, args) </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | drivers/alias/util.go |
storage, err := fs.GetStorage(reqPath, &fs.GetStoragesArgs{NoLog: true}) | <mask> }
<mask>
<mask> func (d *Alias) link(ctx context.Context, dst, sub string, args model.LinkArgs) (*model.Link, error) {
<mask> reqPath := stdpath.Join(dst, sub)
<mask> storage, err := fs.GetStorage(reqPath)
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask> _, err = fs.Get(ctx, reqPath)
<mask> if err != nil {
</s> perf(alias): disabled log on fs call (close #4054) </s> remove obj, err := fs.Get(ctx, stdpath.Join(dst, sub))
</s> add obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true}) </s> remove objs, err := fs.List(ctx, stdpath.Join(dst, sub))
</s> add objs, err := fs.List(ctx, stdpath.Join(dst, sub), &fs.ListArgs{NoLog: true}) </s> remove _, err = fs.Get(ctx, reqPath)
</s> add _, err = fs.Get(ctx, reqPath, &fs.GetArgs{NoLog: true}) </s> remove func GetStorage(path string) (driver.Driver, error) {
</s> add type GetStoragesArgs struct {
NoLog bool
}
func GetStorage(path string, args *GetStoragesArgs) (driver.Driver, error) { </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | drivers/alias/util.go |
_, err = fs.Get(ctx, reqPath, &fs.GetArgs{NoLog: true}) | <mask> storage, err := fs.GetStorage(reqPath)
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask> _, err = fs.Get(ctx, reqPath)
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask> if common.ShouldProxy(storage, stdpath.Base(sub)) {
<mask> return &model.Link{
</s> perf(alias): disabled log on fs call (close #4054) </s> remove storage, err := fs.GetStorage(reqPath)
</s> add storage, err := fs.GetStorage(reqPath, &fs.GetStoragesArgs{NoLog: true}) </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { </s> remove fi, err := fs.Get(ctx, reqPath)
</s> add fi, err := fs.Get(ctx, reqPath, &fs.GetArgs{}) </s> remove fi, err := fs.Get(ctx, reqPath)
</s> add fi, err := fs.Get(ctx, reqPath, &fs.GetArgs{}) </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | drivers/alias/util.go |
<mask> github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
<mask> github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
<mask> github.com/hirochachacha/go-smb2 v1.1.0 h1:b6hs9qKIql9eVXAiN0M2wSFY5xnhbHAQoCwRKbaRTZI=
<mask> github.com/hirochachacha/go-smb2 v1.1.0/go.mod h1:8F1A4d5EZzrGu5R7PU163UcMRDJQl4FtcxjBfsY8TZE=
<mask> github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
<mask> github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
<mask> github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
<mask> github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
<mask> github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
<mask> github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
<mask> github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
</s> perf(alias): disabled log on fs call (close #4054) </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove fi, err = fs.Get(ctx, indexPath)
</s> add fi, err = fs.Get(ctx, indexPath, &fs.GetArgs{}) </s> remove objs, err := List(context.WithValue(ctx, "meta", meta), name)
</s> add objs, err := List(context.WithValue(ctx, "meta", meta), name, &ListArgs{}) </s> remove }, refresh...)
</s> add }, args.Refresh) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | go.sum | |
<mask> github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
<mask> github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
<mask> github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
<mask> github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
<mask> github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
<mask> github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
<mask> github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
<mask> github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
<mask> github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
<mask> github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
<mask> github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
</s> perf(alias): disabled log on fs call (close #4054) </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove fi, err = fs.Get(ctx, indexPath)
</s> add fi, err = fs.Get(ctx, indexPath, &fs.GetArgs{}) </s> remove objs, err := List(context.WithValue(ctx, "meta", meta), name)
</s> add objs, err := List(context.WithValue(ctx, "meta", meta), name, &ListArgs{}) </s> remove }, refresh...)
</s> add }, args.Refresh) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | go.sum | |
<mask> github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
<mask> github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
<mask> github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU=
<mask> github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
<mask> github.com/upyun/go-sdk/v3 v3.0.3 h1:2wUkNk2fyJReMYHMvJyav050D83rYwSjN7mEPR0Pp8Q=
<mask> github.com/upyun/go-sdk/v3 v3.0.3/go.mod h1:P/SnuuwhrIgAVRd/ZpzDWqCsBAf/oHg7UggbAxyZa0E=
<mask> github.com/upyun/go-sdk/v3 v3.0.4 h1:2DCJa/Yi7/3ZybT9UCPATSzvU3wpPPxhXinNlb1Hi8Q=
<mask> github.com/upyun/go-sdk/v3 v3.0.4/go.mod h1:P/SnuuwhrIgAVRd/ZpzDWqCsBAf/oHg7UggbAxyZa0E=
<mask> github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc=
<mask> github.com/winfsp/cgofuse v1.5.0 h1:MsBP7Mi/LiJf/7/F3O/7HjjR009ds6KCdqXzKpZSWxI=
<mask> github.com/winfsp/cgofuse v1.5.0/go.mod h1:h3awhoUOcn2VYVKCwDaYxSLlZwnyK+A8KaDoLUp2lbU=
</s> perf(alias): disabled log on fs call (close #4054) </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove fi, err = fs.Get(ctx, indexPath)
</s> add fi, err = fs.Get(ctx, indexPath, &fs.GetArgs{}) </s> remove objs, err := List(context.WithValue(ctx, "meta", meta), name)
</s> add objs, err := List(context.WithValue(ctx, "meta", meta), name, &ListArgs{}) </s> remove }, refresh...)
</s> add }, args.Refresh) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | go.sum | |
type ListArgs struct {
Refresh bool
NoLog bool
}
func List(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) {
res, err := list(ctx, path, args) | <mask> // the param named path of functions in this package is a mount path
<mask> // So, the purpose of this package is to convert mount path to actual path
<mask> // then pass the actual path to the op package
<mask>
<mask> func List(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error) {
<mask> res, err := list(ctx, path, refresh...)
<mask> if err != nil {
<mask> log.Errorf("failed list %s: %+v", path, err)
<mask> return nil, err
<mask> }
<mask> return res, nil
</s> perf(alias): disabled log on fs call (close #4054) </s> remove func Get(ctx context.Context, path string) (model.Obj, error) {
</s> add type GetArgs struct {
NoLog bool
}
func Get(ctx context.Context, path string, args *GetArgs) (model.Obj, error) { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove func list(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error) {
</s> add func list(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) { </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { </s> remove objs, err := fs.List(ctx, stdpath.Join(dst, sub))
</s> add objs, err := fs.List(ctx, stdpath.Join(dst, sub), &fs.ListArgs{NoLog: true}) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | internal/fs/fs.go |
type GetArgs struct {
NoLog bool
}
func Get(ctx context.Context, path string, args *GetArgs) (model.Obj, error) { | <mask> }
<mask> return res, nil
<mask> }
<mask>
<mask> func Get(ctx context.Context, path string) (model.Obj, error) {
<mask> res, err := get(ctx, path)
<mask> if err != nil {
<mask> log.Errorf("failed get %s: %+v", path, err)
<mask> return nil, err
<mask> }
</s> perf(alias): disabled log on fs call (close #4054) </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove func List(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error) {
res, err := list(ctx, path, refresh...)
</s> add type ListArgs struct {
Refresh bool
NoLog bool
}
func List(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) {
res, err := list(ctx, path, args) </s> remove obj, err := fs.Get(ctx, stdpath.Join(dst, sub))
</s> add obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true}) </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove func GetStorage(path string) (driver.Driver, error) {
</s> add type GetStoragesArgs struct {
NoLog bool
}
func GetStorage(path string, args *GetStoragesArgs) (driver.Driver, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | internal/fs/fs.go |
if err != nil && !args.NoLog { | <mask> }
<mask>
<mask> func Get(ctx context.Context, path string) (model.Obj, error) {
<mask> res, err := get(ctx, path)
<mask> if err != nil {
<mask> log.Errorf("failed get %s: %+v", path, err)
<mask> return nil, err
<mask> }
<mask> return res, nil
<mask> }
</s> perf(alias): disabled log on fs call (close #4054) </s> remove func Get(ctx context.Context, path string) (model.Obj, error) {
</s> add type GetArgs struct {
NoLog bool
}
func Get(ctx context.Context, path string, args *GetArgs) (model.Obj, error) { </s> remove func List(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error) {
res, err := list(ctx, path, refresh...)
</s> add type ListArgs struct {
Refresh bool
NoLog bool
}
func List(ctx context.Context, path string, args *ListArgs) ([]model.Obj, error) {
res, err := list(ctx, path, args) </s> remove obj, err := fs.Get(ctx, stdpath.Join(dst, sub))
</s> add obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true}) </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove func GetStorage(path string) (driver.Driver, error) {
</s> add type GetStoragesArgs struct {
NoLog bool
}
func GetStorage(path string, args *GetStoragesArgs) (driver.Driver, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | internal/fs/fs.go |
type GetStoragesArgs struct {
NoLog bool
}
func GetStorage(path string, args *GetStoragesArgs) (driver.Driver, error) { | <mask> }
<mask> return err
<mask> }
<mask>
<mask> func GetStorage(path string) (driver.Driver, error) {
<mask> storageDriver, _, err := op.GetStorageAndActualPath(path)
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask> return storageDriver, nil
</s> perf(alias): disabled log on fs call (close #4054) </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove if err != nil {
</s> add if err != nil && !args.NoLog { </s> remove _, err = fs.Get(ctx, reqPath)
</s> add _, err = fs.Get(ctx, reqPath, &fs.GetArgs{NoLog: true}) </s> remove if _, err := fs.Get(ctx, reqPath); err != nil {
</s> add if _, err := fs.Get(ctx, reqPath, &fs.GetArgs{}); err != nil { </s> remove func Get(ctx context.Context, path string) (model.Obj, error) {
</s> add type GetArgs struct {
NoLog bool
}
func Get(ctx context.Context, path string, args *GetArgs) (model.Obj, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/alist-org/alist/commit/0f8a84f67eb3970e6a1d0c57a3541bafb70e3d0e | internal/fs/fs.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.