Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
static
to resources
. Embed them at build time
- Loading branch information
Showing
13 changed files
with
39 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// +build !embed | ||
|
||
package resources | ||
|
||
import ( | ||
"io/ioutil" | ||
"net/http" | ||
"sync" | ||
|
||
"github.com/deluan/navidrome/log" | ||
) | ||
|
||
var once sync.Once | ||
|
||
func Asset(filePath string) ([]byte, error) { | ||
f, err := AssetFile().Open(filePath) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return ioutil.ReadAll(f) | ||
} | ||
|
||
func AssetFile() http.FileSystem { | ||
once.Do(func() { | ||
log.Warn("Using external resources from 'resources' folder") | ||
}) | ||
return http.Dir("resources") | ||
} |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.