Setup husky hooks for api
This commit is contained in:
parent
0a5e6bf350
commit
95c174d3a5
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$')
|
||||
[ -z "$gofiles" ] && exit 0
|
||||
|
||||
# Automatically format go code, exit on error
|
||||
echo "Formatting staged go files"
|
||||
gofmt -w $gofiles
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd ui
|
||||
npx lint-staged
|
|
@ -1,4 +1,8 @@
|
|||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
cd ui && npx lint-staged
|
||||
## Lint UI
|
||||
sh "$(dirname "$0")/lint-ui.sh"
|
||||
|
||||
## Lint API
|
||||
sh "$(dirname "$0")/lint-api.sh"
|
||||
|
|
|
@ -87,7 +87,7 @@ func (c *AlbumScannerCache) GetMediaType(path string) (*MediaType, error) {
|
|||
return mediaType, nil
|
||||
}
|
||||
|
||||
func (c *AlbumScannerCache) GetAlbumIgnore(path string) (*[]string) {
|
||||
func (c *AlbumScannerCache) GetAlbumIgnore(path string) *[]string {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ func SaveEXIF(tx *gorm.DB, media *models.Media) (*models.MediaEXIF, error) {
|
|||
parser = &externalExifParser{}
|
||||
}
|
||||
|
||||
|
||||
exif, err := parser.ParseExif(media)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to parse exif data")
|
||||
|
|
|
@ -101,7 +101,7 @@ func findAlbumsForUser(db *gorm.DB, user *models.User, album_cache *AlbumScanner
|
|||
|
||||
// Skip this dir if in ignore list
|
||||
ignorePaths := ignore.CompileIgnoreLines(albumIgnore...)
|
||||
if (ignorePaths.MatchesPath(albumPath + "/")) {
|
||||
if ignorePaths.MatchesPath(albumPath + "/") {
|
||||
log.Printf("Skip, directroy %s is in ignore file", albumPath)
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue