Hyperline / hyperline

✨ Status line plugin for Hyper ✨
MIT License
616 stars 120 forks source link

error when specifying any config in .hyper.js. #67

Closed adccb closed 6 years ago

adccb commented 7 years ago

hey! i'm getting the following error when i specify anything in hyperline config in .hyper.js., even when thee hyperline is copied and pasted from the README. here's my conf file:

module.exports = {
  config: {
    hyperBorder: {
      borderColors: ['#ff3186', '#83c482', '#481ea4'],
      borderWidth: '7px',
      borderAngle: '45deg'
    },

    hyperline: {
     background: 'transparent',
     color: 'black',
     plugins: [
       {
         name: 'hostname',
         options: {
           color: 'lightBlue'
         }
       },
       {
         name: 'ip',
         options: {
           color: 'magenta'
         }
       },
       {
         name: 'memory',
         options: {
           color: 'white'
         }
       },
       {
         name: 'uptime',
         options: {
           color: 'lightYellow'
         }
       },
       {
         name: 'cpu',
         options: {
           colors: {
             high: 'lightRed',
             moderate: 'lightYellow',
             low: 'lightGreen'
           }
         }
       },
       {
         name: 'network',
         options: {
           color: 'lightCyan'
         }
       },
       {
         name: 'battery',
         options: {
           colors: {
             fine: 'lightGreen',
             critical: 'lightRed'
           }
         }
       }
     ]
   },
    fontSize: 16,
    fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
    cursorColor: 'rgba(248,28,229,0.8)',
    cursorShape: 'BEAM',
    foregroundColor: '#fff',
    backgroundColor: '#000',
    borderColor: '#333',
    css: '',
    termCSS: '',
    showHamburgerMenu: '',
    showWindowControls: '',
    padding: '12px 14px',
    colors: {
      black: '#000000',
      red: '#ff0000',
      green: '#33ff00',
      yellow: '#ffff00',
      blue: '#0066ff',
      magenta: '#cc00ff',
      cyan: '#00ffff',
      white: '#d0d0d0',
      lightBlack: '#808080',
      lightRed: '#ff0000',
      lightGreen: '#33ff00',
      lightYellow: '#ffff00',
      lightBlue: '#0066ff',
      lightMagenta: '#cc00ff',
      lightCyan: '#00ffff',
      lightWhite: '#ffffff'
    },
    shell: '',
    shellArgs: ['--login'],
    env: {},
    bell: false,
    copyOnSelect: false
  },
  plugins: [
    "hypercwd",
    "hyperborder",
    "hyperterm-tab-icons",
    "hyperlayout",
    "hyperline"
  ]
};

opened dev tools in the app, and got the following error:

Uncaught TypeError: Cannot read property 'options' of undefined from hyperline.js:331.

thanks!

adccb commented 7 years ago

did some more testing. it looks like the problem is just when i specify

{ 
  name: 'ip', options: { 
    color: 'magenta' 
  } 
},

in my .hyper.js. digging into the source now :)