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
This commit is contained in:
Jack Li 2019-05-30 11:31:57 -07:00 committed by R. Belmont
parent a94e08d1d1
commit 2da86cda04
3 changed files with 3 additions and 16 deletions

View File

@ -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')

View File

@ -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:

View File

@ -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"