• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

How to update.

Scheduled Pinned Locked Moved Tutorials
35 Posts 21 Posters 91.2k Views 20 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    Snille Module Developer @izanbard
    last edited by Snille Mar 16, 2017, 11:42 AM Mar 16, 2017, 7:28 AM

    @izanbard Hello, added a restart of the mirror (via pm2) if an npm install has been done and also added “–production” to the npm install command. Sometimes the module-developer have lot’s of extra stuff added in the package list just for developing. :)
    I’m currently now running this script via CRON every night. :)

    #!/usr/bin/env bash
    
    updated=false
    
    cd /home/pi/MagicMirror
    echo "Checking for MagicMirror updates."
    git fetch
    if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]
    then
        echo "Found, updating..."
        git pull
        npm install
        updated=true
        echo "Update done."
    else
        echo "No update needed."
    fi
    echo ""
    
    cd modules
    
    for directory in *; do
        if [[ -d ${directory} && ${directory} != "node_modules" && ${directory} != "default" ]]; then
            echo "Checking for ${directory} updates."
            cd ${directory}
            git fetch
            if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
                echo "Found, updating ${directory}..."
                git pull
                if [[ -e "package.json" && -f "package.json" ]]; then
                    echo "package.joson changed for ${directory}, installing..."
                    npm install --production 
                    updated=true
                    echo "Update done."
                fi
            else
                echo "No update needed."
            fi
            echo ""
            cd ..
        fi
    done
    
    if $updated; then
        echo "Restart of MM needed, restarting now."
        pm2 restart mm
    fi
    echo "All done. :)"
    

    If you cant find it, make it and share it!
    Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

    D 1 Reply Last reply Dec 4, 2017, 11:03 AM Reply Quote 0
    • R Offline
      RudyAcevedo @izanbard
      last edited by Apr 5, 2017, 10:34 AM

      @izanbard Thank you!!

      1 Reply Last reply Reply Quote 0
      • B Offline
        batzyn
        last edited by yawns Apr 7, 2017, 10:17 AM Apr 7, 2017, 4:45 AM

        thank u!

        A 1 Reply Last reply Apr 16, 2017, 6:29 PM Reply Quote 0
        • A Offline
          akrishnan.j @batzyn
          last edited by Apr 16, 2017, 6:29 PM

          @batzyn

          pi@akpi:~/MagicMirror $ sudo git pull && npm install
          Updating 8010e62…5c41e24
          error: Your local changes to the following files would be overwritten by merge:
          css/main.css
          Please, commit your changes or stash them before you can merge.
          Aborting
          Any ideas…

          J S 2 Replies Last reply Apr 16, 2017, 6:54 PM Reply Quote 0
          • J Offline
            johnnyboy @akrishnan.j
            last edited by johnnyboy Apr 16, 2017, 9:01 PM Apr 16, 2017, 6:54 PM

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • U Offline
              Unbored @izanbard
              last edited by May 8, 2017, 11:47 PM

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • U Offline
                Unbored @izanbard
                last edited by May 8, 2017, 11:50 PM

                @izanbard Thank you.

                 #!/usr/bin/env bash
                
                cd /home/pi/MagicMirror
                echo "######### CHECKING MAGIC MIRROR ##########"
                

                Has anyone else deployed this script?

                When I try to run it as a .py or .sh there is an error on line 6 stating invalid syntax at the end of the first echo row. Any suggestions on clearing this issue?

                B 1 Reply Last reply May 12, 2017, 1:51 PM Reply Quote 0
                • B Offline
                  Binog @Unbored
                  last edited by May 12, 2017, 1:51 PM

                  @Unbored
                  Delete the " and add straight ones again " (If You edited this file via an alternate editor on win/Mac then it might be a cursive "… try it, worked for me!

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    KX900
                    last edited by May 23, 2017, 6:26 PM

                    hi

                    i get this message:

                    error: Your local changes to the following files would be overwritten by merge:
                    	modules/default/calendar/calendar.js
                    	modules/default/compliments/compliments.js
                    	modules/default/newsfeed/newsfeed.js
                    Please, commit your changes or stash them before you can merge.
                    Aborting
                    
                    

                    what should i do?

                    B 1 Reply Last reply May 23, 2017, 6:28 PM Reply Quote 0
                    • B Offline
                      broberg Project Sponsor @KX900
                      last edited by May 23, 2017, 6:28 PM

                      @KX900 backup those files somewhere if you want to keep the changes you’ve made (you shouldn’t have made any changes in those files unless you really reaally had to) and then delete them and try to update again.

                      K 1 Reply Last reply May 23, 2017, 8:31 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 2 / 4
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy