Skip to content
Snippets Groups Projects
Select Git revision
  • ab9dcae365f171cfaa8290802e27e05bb33e2bd9
  • master default protected
  • dev
  • appimage
  • fix_gitlab
  • fixappveyor
  • gitlab
  • fix_ci
  • fix_dbus_error
  • fix_ci_osx
  • sakia020
  • fix_travis#1105
  • feature/backend
  • check_uniq_node_by_endpoints
  • qt5.7
  • feature/agent_architecture
  • translations
  • pyqt5.6
  • qtwebengine
  • pyinstaller
  • landscape
  • 0.53.2
  • 0.53.1
  • 0.53.0
  • 0.52.0
  • 0.51.1
  • 0.51.0
  • 0.50.5
  • 0.50.4
  • 0.50.3
  • 0.50.2
  • 0.50.1
  • 0.50.0
  • 0.33.0rc7
  • 0.33.0rc6
  • 0.33.0rc5
  • 0.33.0rc4
  • 0.33.0rc3
  • 0.33.0rc2
  • 0.33.0rc1
  • 0.32.10post1
41 results

main.py

Blame
  • duniter.sh 834 B
    #!/bin/bash
    
    ##########################
    #    DUNITER EXECUTABLE
    #
    # Wraps bin/duniter that is called with Node.js
    #
    
    DEB_PACKAGING=
    
    if [[ $DEB_PACKAGING ]]; then
      DUNITER_DIR=/opt/duniter/
    fi
    
    duniter() {
    
    	local NODE
    	local LOGS_FILE
    
    	if [ -z "$DEV_MODE" ]; then
    
    		### Production mode
    		if [[ -d $DUNITER_DIR/node ]]; then
    			NODE=$DUNITER_DIR/node/bin/node
    	  else
    	    echo "Node.js is not embedded in this version of Duniter"
    	    return
    		fi;
    	else
    
    		### Cheating with DEV mode
    		DUNITER_DIR=`pwd`
    		NODE=node
    	fi
    
    	VERSION=`$NODE -v`
    
    	if [[ $VERSION != v8* ]]; then
    	  echo "$NODE v8 is required";
    	else
    
    	  # Calls duniter JS command
    	  cd $DUNITER_DIR
    	  $NODE "$DUNITER_DIR/bin/duniter" "$@"
    
    	fi;
    }
    
    # If the script was launched with parameters, try to launch the Duniter command
    if [ ! -z $1 ]; then
    	duniter "$@"
    fi