Skip to content

Commit

Permalink
rancher@centurix: Fix for Cinnamon 3.8 (#1694)
Browse files Browse the repository at this point in the history
(cinnamon:97022): Cjs-WARNING **: 06:56:52.885: Some code accessed the
property 'STATUS_HOMESTEAD_MISSING' on the module 'homestead'. That
property was defined with 'let' or 'const' inside the module. This was
previously supported, but is not correct according to the ES6 standard.
Any symbols to be exported from a module must be defined with 'var'. The
property access will work as previously for the time being, but please
fix your code anyway.
  • Loading branch information
jaszhix committed Mar 21, 2018
1 parent 3f77b04 commit f259330
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
12 changes: 9 additions & 3 deletions rancher@centurix/files/rancher@centurix/applet.js
Expand Up @@ -3,9 +3,15 @@ const PopupMenu = imports.ui.popupMenu;
const Lang = imports.lang;
const Settings = imports.ui.settings;
const Gtk = imports.gi.Gtk;
const AppletDir = imports.ui.appletManager.applets['rancher@centurix'];
const Homestead = AppletDir.homestead;
const Util = AppletDir.util;
let Homestead, Util;
if (typeof require !== 'undefined') {
Homestead = require('./homestead');
Util = require('./util');
} else {
const AppletDir = imports.ui.appletManager.applets['rancher@centurix'];
Homestead = AppletDir.homestead;
Util = AppletDir.util;
}
const MessageTray = imports.ui.messageTray;
const Main = imports.ui.main;
const St = imports.gi.St;
Expand Down
31 changes: 19 additions & 12 deletions rancher@centurix/files/rancher@centurix/homestead.js
@@ -1,18 +1,25 @@
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Main = imports.ui.main;
const AppletDir = imports.ui.appletManager.applets['rancher@centurix'];
const Util = AppletDir.util;
const HomesteadYamlReader = AppletDir.homestead_yaml_reader;
const TerminalReader = AppletDir.terminal_reader;

const STATUS_RUNNING = 0;
const STATUS_SAVED = 1;
const STATUS_POWER_OFF = 2;
const STATUS_NOT_CREATED = 3;
const STATUS_HOMESTEAD_MISSING = 4;
const STATUS_KERNAL_NOT_LOADED = 5;
const STATUS_VAGRANT_OUT_OF_DATE = 6;
let Util, HomesteadYamlReader, TerminalReader;
if (typeof require !== 'undefined') {
Util = require('./util');
HomesteadYamlReader = require('./homestead_yaml_reader');
TerminalReader = require('./terminal_reader');
} else {
const AppletDir = imports.ui.appletManager.applets['rancher@centurix'];
Util = AppletDir.util;
HomesteadYamlReader = AppletDir.homestead_yaml_reader;
TerminalReader = AppletDir.terminal_reader;
}

var STATUS_RUNNING = 0;
var STATUS_SAVED = 1;
var STATUS_POWER_OFF = 2;
var STATUS_NOT_CREATED = 3;
var STATUS_HOMESTEAD_MISSING = 4;
var STATUS_KERNAL_NOT_LOADED = 5;
var STATUS_VAGRANT_OUT_OF_DATE = 6;

/**
* Homestead/Vagrant manager
Expand Down

0 comments on commit f259330

Please sign in to comment.