Skip to content

Commit

Permalink
Introduce --skip-profile-pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
wetneb committed Dec 14, 2024
1 parent 956b26f commit fdb7f68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func init() {
TransformSlackCmd.Flags().BoolP("skip-convert-posts", "c", false, "Skips converting mentions and post markup. Only for testing purposes")
TransformSlackCmd.Flags().BoolP("skip-attachments", "a", false, "Skips copying the attachments from the import file")
TransformSlackCmd.Flags().Bool("skip-empty-emails", false, "Ignore empty email addresses from the import file. Note that this results in invalid data.")
TransformSlackCmd.Flags().Bool("skip-profile-pictures", false, "Skips copying the profile pictures from the import file")
TransformSlackCmd.Flags().String("default-email-domain", "", "If this flag is provided: When a user's email address is empty, the output's email address will be generated from their username and the provided domain.")
TransformSlackCmd.Flags().BoolP("allow-download", "l", false, "Allows downloading the attachments for the import file")
TransformSlackCmd.Flags().BoolP("discard-invalid-props", "p", false, "Skips converting posts with invalid props instead discarding the props themselves")
Expand All @@ -65,6 +66,7 @@ func transformSlackCmdF(cmd *cobra.Command, args []string) error {
attachmentsDir, _ := cmd.Flags().GetString("attachments-dir")
skipConvertPosts, _ := cmd.Flags().GetBool("skip-convert-posts")
skipAttachments, _ := cmd.Flags().GetBool("skip-attachments")
skipProfilePictures, _ := cmd.Flags().GetBool("skip-profile-pictures")
skipEmptyEmails, _ := cmd.Flags().GetBool("skip-empty-emails")
defaultEmailDomain, _ := cmd.Flags().GetString("default-email-domain")
allowDownload, _ := cmd.Flags().GetBool("allow-download")
Expand Down Expand Up @@ -94,7 +96,7 @@ func transformSlackCmdF(cmd *cobra.Command, args []string) error {
}

profilePicturesDir := path.Join(attachmentsDir, "profile_pictures")
if !skipAttachments {
if !skipProfilePictures {
if fileInfo, err := os.Stat(profilePicturesDir); os.IsNotExist(err) {
if createErr := os.MkdirAll(profilePicturesDir, 0755); createErr != nil {
return createErr
Expand Down

0 comments on commit fdb7f68

Please sign in to comment.