Bugsounet Coding

    • Register
    • Login
    • Search
    This Forum is now reserved to registred users!

    Unsolved [V4.x Coding] Installer update and rebuild scripts assume MagicMirror location

    Issues
    3
    5
    187
    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.
    • doctorfree
      doctorfree last edited by bugsounet

      The installer/rebuild.sh and installer/update.sh scripts attempt to:

      cd ~/MagicMirror/modules/MMM-GoogleAssistant

      The assumption that MagicMirror was installed in the user’s home directory is almost always correct but, in my case, not so. I have installed MagicMirror in /usr/local/MagicMirror. This same assumption is also made by the MMM-Detector scripts and maybe other modules as well.

      I am able to work around the issue by editing the installer scripts prior to running an update or rebuild. I do not know if you wish to support alternate MagicMirror installation locations in your installer scripts but if you do, here is what I do in my scripts:

      MM=${HOME}/MagicMirror
      
      [ -d ${MM}/config ] || {
            MM=
            for homedir in /usr/local /home/*
            do
                [ "${homedir}" == "/home/*" ] && continue
                [ -d ${homedir}/MagicMirror/config ] && {
                    MM="${homedir}/MagicMirror"
                    break
                }
            done
      }
      

      Alternately, the update and rebuild npm commands are being run in the module’s installation directory so is there really a need to change directory using an absolute pathname? Maybe it is preferable to simply cd .. or not at all? I leave it up to you, just letting you know that the scripts break on some MagicMirror installations.

      1 Reply Last reply Reply Quote 0
      • R
        Ray BetaTester last edited by

        I actually made a pretty simple script is pretty basic but it works.
        It just copies everything in the directories over to my server and in the event of something going wrong. I can restore them as well. It’s pretty simple

        1 Reply Last reply Reply Quote 0
        • bugsounet
          bugsounet Main Coder last edited by bugsounet

          I think, it’s better to do something else for v4
          @doctorfree, you want to do something else… you can purpose in v4.x branch 😉
          Actually, i don’t really want to correct / add some feature in v3.3.x

          1 Reply Last reply Reply Quote 0
          • doctorfree
            doctorfree last edited by

            I will look at v4 and contribute what I can. I appreciate your efforts and good work.

            With respect to the MagicMirror installation location, I am resolving this on my end by creating a symbolic link in the user’s home directory if no MagicMirror directory exists there. The symbolic link points to the detected MagicMirror location. This will make my code compatible with modules that assume /home/pi/MagicMirror/modules is where they are installed. I don’t think non-standard MagicMirror install location is very common but I prefer placing it in a location all users can access. Anyway, this change is not high priority and I agree it can wait till we have something agreeable in v4.

            1 Reply Last reply Reply Quote 0
            • bugsounet
              bugsounet Main Coder last edited by

              actually, not many new thing is coded in v4…
              I decode all sub-module and recode it in a separate module
              actually +/- done :

              • EXT-Volume
              • EXT-YouTubeCast
              • EXT-Links

              ALL Features will be decoded to recode it in a separate module (with EXT-*)
              I think, i will take one month to do it …

              Final result will be a Clean GA module with EXT-* module to install on demand 🙂
              ALL RPI user can install module wanted

              1 Reply Last reply Reply Quote 0
              • Pinned by  bugsounet bugsounet 
              • Unpinned by  bugsounet bugsounet 
              • First post
                Last post
              Powered by NodeBB | @bugsounet ©2022