Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Derive version string
id: bin_version
run: echo "bin_version=$(./.version.sh)" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -76,11 +76,11 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Generate build dependencies
run: make deps
- name: golangci-lint
uses: golangci/golangci-lint-action@v6.0.1
uses: golangci/golangci-lint-action@v8
with:
version: latest
- name: ShellCheck
Expand All @@ -90,9 +90,9 @@ jobs:
- name: Prettier
run: prettier --check .
- name: Actionlint
uses: raven-actions/actionlint@v2
uses: raven-actions/actionlint@v2.0.1
- name: Setup shfmt
uses: mfinelli/setup-shfmt@v3.0.1
uses: mfinelli/setup-shfmt@v4
- name: shfmt
run: shfmt -d .

Expand All @@ -104,10 +104,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: Go version
Expand Down Expand Up @@ -137,15 +137,15 @@ jobs:
contents: write
steps:
- name: Download binaries & packages
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: ${{ needs.meta.outputs.bin_name }} Binary Artifacts
path: out
- name: List artifacts
working-directory: out
run: ls -R
- name: Create GitHub release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: out/${{ needs.meta.outputs.bin_name }}-*
prerelease: ${{ needs.meta.outputs.is_prerelease == 'true' }}
Expand All @@ -161,7 +161,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Update running major/minor version tags
uses: sersoft-gmbh/running-release-tags-action@v3
with:
Expand All @@ -176,7 +176,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release to ${{ needs.meta.outputs.brewtap_owner }}/${{ needs.meta.outputs.brewtap_name }} tap
uses: Justintime50/homebrew-releaser@v1
uses: Justintime50/homebrew-releaser@v2
with:
homebrew_owner: ${{ needs.meta.outputs.brewtap_owner }}
homebrew_tap: homebrew-${{ needs.meta.outputs.brewtap_name }}
Expand All @@ -200,7 +200,7 @@ jobs:
needs: [meta, lint, binaries, tags, release, homebrew]
steps:
- name: Send success notification
uses: niniyas/ntfy-action@master
uses: niniyas/ntfy-action@V1.0.5
if: ${{ !contains(needs.*.result, 'failure') && (needs.meta.outputs.is_release == 'true' || needs.meta.outputs.is_prerelease == 'true') }}
with:
url: "https://ntfy.cdzombak.net"
Expand All @@ -211,7 +211,7 @@ jobs:
title: ${{ github.event.repository.name }} ${{ needs.meta.outputs.bin_version }} available
details: ${{ github.event.repository.name }} version ${{ needs.meta.outputs.bin_version }} is now available.
- name: Send failure notification
uses: niniyas/ntfy-action@master
uses: niniyas/ntfy-action@V1.0.5
if: ${{ contains(needs.*.result, 'failure') }}
with:
url: "https://ntfy.cdzombak.net"
Expand Down
4 changes: 2 additions & 2 deletions camswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (p *camswapCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interfac
return subcommands.ExitFailure
}
//goland:noinspection GoUnhandledErrorResult
defer os.Remove(exiftoolConfigFilename)
defer func() { _ = os.Remove(exiftoolConfigFilename) }()

var exiftoolArgs []string
if p.restore {
Expand Down Expand Up @@ -91,7 +91,7 @@ func (p *camswapCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interfac
"-if", "not $XtoolOriginalCameraModel",
}

suffixSafeCamModel := strings.Replace(p.newCamModel, " ", "-", -1)
suffixSafeCamModel := strings.ReplaceAll(p.newCamModel, " ", "-")
if p.outDir != "" && p.suffix {
exiftoolArgs = append(exiftoolArgs, "-o", fmt.Sprintf("%s%s%%d%%f_%s.%%e", p.outDir, string(os.PathSeparator), suffixSafeCamModel))
} else if p.suffix {
Expand Down
2 changes: 1 addition & 1 deletion inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (p *inspectCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interfac
return subcommands.ExitFailure
}
//goland:noinspection GoUnhandledErrorResult
defer os.Remove(exiftoolConfigFilename)
defer func() { _ = os.Remove(exiftoolConfigFilename) }()

swapExiftoolArgs := []string{"-j", "-f", "-Model", "-XtoolOriginalCameraModel"}
locationExiftoolArgs := []string{"-j", "-gps*"}
Expand Down
4 changes: 2 additions & 2 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os/exec"
"path/filepath"

"github.com/codeclysm/extract/v4"
extract "github.com/codeclysm/extract/v4"
"github.com/google/subcommands"
)

Expand Down Expand Up @@ -90,7 +90,7 @@ func installApplescripts(ctx context.Context) error {
return fmt.Errorf("failed to create temporary directory: %w", err)
}
//goland:noinspection GoUnhandledErrorResult
defer os.RemoveAll(workDir)
defer func() { _ = os.RemoveAll(workDir) }()

buffer := bytes.NewBuffer(applescriptsArchive)
err = extract.Tar(ctx, buffer, workDir, nil)
Expand Down
7 changes: 4 additions & 3 deletions neatimg.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ func NeatImageProcess(args []string, files []string, appConfig AppConfig, verbos
fullArgs = append(fullArgs, args...)

inputExt := strings.ToLower(filepath.Ext(imgFilename))
if inputExt == ".jpg" || inputExt == ".jpeg" {
switch inputExt {
case ".jpg", ".jpeg":
fullArgs = append(fullArgs, "--output-format=JPG")
} else if inputExt == ".tif" || inputExt == ".tiff" {
case ".tif", ".tiff":
fullArgs = append(fullArgs, "--output-format=TIF")
} else if inputExt == ".png" {
case ".png":
fullArgs = append(fullArgs, "--output-format=PNG")
}

Expand Down
5 changes: 3 additions & 2 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ func (c BackupsConfig) PrepareBackupsDir(filename string, startTime time.Time) (
return "", err
}
var parentMode os.FileMode
if c.BackupsLocation == BackupsLocSubDir {
switch c.BackupsLocation {
case BackupsLocSubDir:
backupsPath = filepath.Join(
filepath.Dir(absFilePath),
fmt.Sprintf("%s_%s", c.BackupsFolder, ts),
Expand All @@ -28,7 +29,7 @@ func (c BackupsConfig) PrepareBackupsDir(filename string, startTime time.Time) (
return "", err
}
parentMode = stat.Mode() & os.ModePerm
} else if c.BackupsLocation == BackupsLocAbsPath {
case BackupsLocAbsPath:
backupsPath = filepath.Join(
c.BackupsFolder,
fmt.Sprintf("%s %s", ts, filepath.Base(filepath.Dir(absFilePath))),
Expand Down
Loading