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.

    After need take another config.js

    Scheduled Pinned Locked Moved Troubleshooting
    12 Posts 2 Posters 4.7k Views 2 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.
    • P Offline
      pi-user
      last edited by

      @sdetweil said in After need take another config.js:

      export config

      Where can I put export config? So, that means that I can take another configuration file if necessary?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @pi-user
        last edited by

        @pi-user in the terminal window or script. If pm2 then in installers/mm.sh

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • P Offline
          pi-user
          last edited by

          @sdetweil said in After need take another config.js:

          mm.sh

          I discovered that the file name is defined in the check_config.js file!

          /opt/magic_mirror/tests/configs/check_config.js

          function getConfigFile() {
          // FIXME: This function should be in core. Do you want refactor me ;) ?, be good!
          rootPath = path.resolve(__dirname + “/…/…/”);
          var configFileName = path.resolve(rootPath + “/config/config.js”);
          if (process.env.MM_CONFIG_FILE) {
          configFileName = path.resolve(process.env.MM_CONFIG_FILE);
          }
          return configFileName;
          }

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @pi-user
            last edited by

            @pi-user in electron.js is says process.env.config

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            P 2 Replies Last reply Reply Quote 0
            • P Offline
              pi-user @sdetweil
              last edited by

              @sdetweil

              Thank you

              1 Reply Last reply Reply Quote 0
              • P Offline
                pi-user @sdetweil
                last edited by

                @sdetweil

                I looked at it. But how can I edit this file so that another config file is read? Such as: configXYZ.js and not the standard name config.js

                Thank you

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @pi-user
                  last edited by

                  @pi-user just copy the default config.sample.js to anyname.js

                  then edit that name and do

                  export config=anyname.js
                  npm start

                  if using pm2, then edit the installers/mm.sh file which what pm2 starts
                  and add the export= line

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  P 1 Reply Last reply Reply Quote 0
                  • P Offline
                    pi-user @sdetweil
                    last edited by

                    @sdetweil

                    Thank you:thumbs_up_light_skin_tone:

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil
                      last edited by

                      it doesn’t work… trying to resolve

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil
                        last edited by

                        if can’t get it to work… MM_CONFIG_FILE (full path to file) reads the right config file, but then
                        still get missing config file…

                        AND you MUST have a config.js in the config folder, or nothing will work…

                        sorry, i give up right now…

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • 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