drop package.json, use yarn instad of npm, add build_in_docker.sh
							parent
							
								
									46b5fa013c
								
							
						
					
					
						commit
						f91ee24858
					
				| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
.DS_Store
 | 
			
		||||
node_modules/
 | 
			
		||||
frontend/
 | 
			
		||||
*/dist/*
 | 
			
		||||
*.db
 | 
			
		||||
*.db.lock
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										21
									
								
								build.sh
								
								
								
								
							
							
						
						
									
										21
									
								
								build.sh
								
								
								
								
							| 
						 | 
				
			
			@ -1,14 +1,25 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
cd $(dirname $0)
 | 
			
		||||
 | 
			
		||||
# Clean the dist folder and build the assets
 | 
			
		||||
if [ ! -d "frontend" ]; then
 | 
			
		||||
  git clone -b master https://github.com/filebrowser/frontend
 | 
			
		||||
fi;
 | 
			
		||||
cd frontend
 | 
			
		||||
if [ -d "dist" ]; then
 | 
			
		||||
  rm -rf dist/*
 | 
			
		||||
fi;
 | 
			
		||||
yarn install
 | 
			
		||||
yarn build
 | 
			
		||||
 | 
			
		||||
cd ..
 | 
			
		||||
 | 
			
		||||
# Install rice tool if not present
 | 
			
		||||
if ! [ -x "$(command -v rice)" ]; then
 | 
			
		||||
  go get github.com/GeertJohan/go.rice/rice
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Clean the dist folder and build the assets
 | 
			
		||||
rm -rf node_modules
 | 
			
		||||
npm install
 | 
			
		||||
 | 
			
		||||
# Embed the assets using rice
 | 
			
		||||
rice embed-go
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
cd $(dirname $0)
 | 
			
		||||
 | 
			
		||||
docker pull golang:alpine
 | 
			
		||||
 | 
			
		||||
$(command -v winpty) docker run --rm -it \
 | 
			
		||||
  -v /$(pwd)://src \
 | 
			
		||||
  -w //src \
 | 
			
		||||
  golang:alpine \
 | 
			
		||||
  sh -c '\
 | 
			
		||||
    echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
 | 
			
		||||
    sed -i -e "s/v[0-9]\.[0-9]/edge/g" /etc/apk/repositories  && \
 | 
			
		||||
    apk add -U --no-cache yarn git  && \
 | 
			
		||||
    go get github.com/GeertJohan/go.rice/rice && \
 | 
			
		||||
    ./build.sh \
 | 
			
		||||
  '
 | 
			
		||||
| 
						 | 
				
			
			@ -119,7 +119,7 @@ type FSBuilder func(scope string) FileSystem
 | 
			
		|||
func (m *FileBrowser) Setup() error {
 | 
			
		||||
	// Creates a new File Browser instance with the Users
 | 
			
		||||
	// map and Assets box.
 | 
			
		||||
	m.Assets = rice.MustFindBox("./node_modules/filebrowser-frontend/dist")
 | 
			
		||||
	m.Assets = rice.MustFindBox("./frontend/dist")
 | 
			
		||||
	m.Cron = cron.New()
 | 
			
		||||
 | 
			
		||||
	// Tries to get the encryption key from the database.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +0,0 @@
 | 
			
		|||
{
 | 
			
		||||
  "name": "filebrowser",
 | 
			
		||||
  "author": "File Browser contributors",
 | 
			
		||||
  "private": true,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "filebrowser-frontend": "1.6.0"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue