mirror of
				https://github.com/ether/etherpad-lite.git
				synced 2025-11-04 10:11:33 +01:00 
			
		
		
		
	Better startup & symlinking
This commit is contained in:
		
							parent
							
								
									1239ce7f28
								
							
						
					
					
						commit
						758666c3e1
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -10,3 +10,6 @@ var/dirty.db
 | 
			
		||||
bin/convertSettings.json
 | 
			
		||||
*~
 | 
			
		||||
*.patch
 | 
			
		||||
src/static/js/jquery.js
 | 
			
		||||
src/static/js/prefixfree.js
 | 
			
		||||
npm-debug.log
 | 
			
		||||
 | 
			
		||||
@ -55,7 +55,13 @@ if [ ! -f $settings ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "Ensure that all dependencies are up to date..."
 | 
			
		||||
npm install || { 
 | 
			
		||||
(
 | 
			
		||||
  mkdir -p node_modules
 | 
			
		||||
  cd node_modules
 | 
			
		||||
  [ -e pluginomatic_etherpad-lite ] || ln -s ../src pluginomatic_etherpad-lite
 | 
			
		||||
  cd pluginomatic_etherpad-lite
 | 
			
		||||
  npm install
 | 
			
		||||
) || { 
 | 
			
		||||
  rm -rf node_modules
 | 
			
		||||
  exit 1 
 | 
			
		||||
}
 | 
			
		||||
@ -63,8 +69,8 @@ npm install || {
 | 
			
		||||
echo "Ensure jQuery is downloaded and up to date..."
 | 
			
		||||
DOWNLOAD_JQUERY="true"
 | 
			
		||||
NEEDED_VERSION="1.7.1"
 | 
			
		||||
if [ -f "static/js/jquery.js" ]; then
 | 
			
		||||
  VERSION=$(cat static/js/jquery.js | head -n 3 | grep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?");
 | 
			
		||||
if [ -f "src/static/js/jquery.js" ]; then
 | 
			
		||||
  VERSION=$(cat src/static/js/jquery.js | head -n 3 | grep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?");
 | 
			
		||||
  
 | 
			
		||||
  if [ ${VERSION#v} = $NEEDED_VERSION ]; then
 | 
			
		||||
    DOWNLOAD_JQUERY="false"
 | 
			
		||||
@ -72,14 +78,14 @@ if [ -f "static/js/jquery.js" ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ $DOWNLOAD_JQUERY = "true" ]; then
 | 
			
		||||
  curl -lo static/js/jquery.js http://code.jquery.com/jquery-$NEEDED_VERSION.js || exit 1
 | 
			
		||||
  curl -lo src/static/js/jquery.js http://code.jquery.com/jquery-$NEEDED_VERSION.js || exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "Ensure prefixfree is downloaded and up to date..."
 | 
			
		||||
DOWNLOAD_PREFIXFREE="true"
 | 
			
		||||
NEEDED_VERSION="1.0.4"
 | 
			
		||||
if [ -f "static/js/prefixfree.js" ]; then
 | 
			
		||||
  VERSION=$(cat static/js/prefixfree.js | grep "PrefixFree" | grep -o "[0-9].[0-9].[0-9]");
 | 
			
		||||
if [ -f "src/static/js/prefixfree.js" ]; then
 | 
			
		||||
  VERSION=$(cat src/static/js/prefixfree.js | grep "PrefixFree" | grep -o "[0-9].[0-9].[0-9]");
 | 
			
		||||
  
 | 
			
		||||
  if [ $VERSION = $NEEDED_VERSION ]; then
 | 
			
		||||
    DOWNLOAD_PREFIXFREE="false"
 | 
			
		||||
@ -87,7 +93,7 @@ if [ -f "static/js/prefixfree.js" ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ $DOWNLOAD_PREFIXFREE = "true" ]; then
 | 
			
		||||
  curl -lo static/js/prefixfree.js -k https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.js || exit 1
 | 
			
		||||
  curl -lo src/static/js/prefixfree.js -k https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.js || exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#Remove all minified data to force node creating it new
 | 
			
		||||
@ -98,12 +104,12 @@ echo "ensure custom css/js files are created..."
 | 
			
		||||
 | 
			
		||||
for f in "index" "pad" "timeslider"
 | 
			
		||||
do
 | 
			
		||||
  if [ ! -f "static/custom/$f.js" ]; then
 | 
			
		||||
    cp -v "static/custom/js.template" "static/custom/$f.js" || exit 1
 | 
			
		||||
  if [ ! -f "src/static/custom/$f.js" ]; then
 | 
			
		||||
    cp -v "src/static/custom/js.template" "src/static/custom/$f.js" || exit 1
 | 
			
		||||
  fi
 | 
			
		||||
  
 | 
			
		||||
  if [ ! -f "static/custom/$f.css" ]; then
 | 
			
		||||
    cp -v "static/custom/css.template" "static/custom/$f.css" || exit 1
 | 
			
		||||
  if [ ! -f "src/static/custom/$f.css" ]; then
 | 
			
		||||
    cp -v "src/static/custom/css.template" "src/static/custom/$f.css" || exit 1
 | 
			
		||||
  fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -21,8 +21,7 @@ if [ "$(id -u)" -eq 0 ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#prepare the enviroment
 | 
			
		||||
#bin/installDeps.sh $* || exit 1
 | 
			
		||||
npm link ./src
 | 
			
		||||
bin/installDeps.sh $* || exit 1
 | 
			
		||||
 | 
			
		||||
#Move to the node folder and start
 | 
			
		||||
echo "start..."
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user