summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author Jack Li <jackrjli@berkeley.edu>2019-05-30 11:31:57 -0700
committer R. Belmont <rb6502@users.noreply.github.com>2019-05-30 14:31:57 -0400
commit2da86cda04731e3aa4e59b1ee0c7ff73929897aa (patch)
treebde46a1bc60a3f6762149ea1b52989334592aadb /plugins
parenta94e08d1d1c2e446d9f96c69b00815e0685444fc (diff)
Change autofire config directory to homepath (#5129)
* Revert "Used set_folder to avoid hardcoding plugin name in settings path" This reverts commit 76884986fd8630f81cfc838aa42f264fdcec2ea9. * Changed autofire config directory to homepath * Bumped autofire plugin version
Diffstat (limited to 'plugins')
-rw-r--r--plugins/autofire/autofire_save.lua8
-rw-r--r--plugins/autofire/init.lua9
-rw-r--r--plugins/autofire/plugin.json2
3 files changed, 3 insertions, 16 deletions
diff --git a/plugins/autofire/autofire_save.lua b/plugins/autofire/autofire_save.lua
index b15947fc168..2f353417e3e 100644
--- a/plugins/autofire/autofire_save.lua
+++ b/plugins/autofire/autofire_save.lua
@@ -1,9 +1,7 @@
local lib = {}
-local plugin_path = ''
-
local function get_settings_path()
- return plugin_path .. '/cfg/'
+ return lfs.env_replace(manager:machine():options().entries.homepath:value():match('([^;]+)')) .. '/autofire/'
end
local function get_settings_filename()
@@ -47,10 +45,6 @@ local function serialize_settings(button_list)
return settings
end
-function lib:set_plugin_path(path)
- plugin_path = path
-end
-
function lib:load_settings()
local buttons = {}
local json = require('json')
diff --git a/plugins/autofire/init.lua b/plugins/autofire/init.lua
index 5b52e47d350..1eb8627b494 100644
--- a/plugins/autofire/init.lua
+++ b/plugins/autofire/init.lua
@@ -2,20 +2,13 @@
-- copyright-holders:Jack Li
local exports = {}
exports.name = 'autofire'
-exports.version = '0.0.2'
+exports.version = '0.0.3'
exports.description = 'Autofire plugin'
exports.license = 'The BSD 3-Clause License'
exports.author = { name = 'Jack Li' }
local autofire = exports
-function autofire.set_folder(path)
- local loader = require('autofire/autofire_save')
- if loader then
- loader:set_plugin_path(path)
- end
-end
-
function autofire.startplugin()
-- List of autofire buttons, each being a table with keys:
diff --git a/plugins/autofire/plugin.json b/plugins/autofire/plugin.json
index 89e1a334523..a803c8be09e 100644
--- a/plugins/autofire/plugin.json
+++ b/plugins/autofire/plugin.json
@@ -2,7 +2,7 @@
"plugin": {
"name": "autofire",
"description": "Autofire plugin",
- "version": "0.0.2",
+ "version": "0.0.3",
"author": "Jack Li",
"type": "plugin",
"start": "false"