diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index ab2cf10..7855307 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -467,11 +467,11 @@ class WOStackController(CementBaseController): Log.debug(self, "Setting packages variable for nanorc") apt_packages = apt_packages + ['nano'] packages = [ - ['https://github.com/scopatz/nanorc/archive/master.tar.gz', + ['https://github.com/scopatz/' + 'nanorc/archive/master.tar.gz', '/var/lib/wo/tmp/nanorc.tar.gz', 'nanorc']] - # UTILS if pargs.utils: Log.debug(self, "Setting packages variable for utils") diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 8d86e04..bedc70d 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -1436,6 +1436,19 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOFileUtils.chmod( self, "/usr/local/sbin/update-ngxblocker", 0o700) + if any('/var/lib/wo/tmp/nanorc.tar.gz' == x[1] + for x in packages): + WOExtract.extract(self, '/var/lib/wo/tmp/nanorc.tar.gz', + '/var/lib/wo/tmp/') + WOFileUtils.mvfile(self, '/var/lib/wo/tmp/nanorc-master', + '/usr/share/nano-syntax-highlighting') + if os.path.exists('/etc/nanorc'): + Log.debug( + self, 'including nano syntax highlighting to /etc/nanorc') + WOFileUtils.textappend( + self, '/etc/nanorc', 'include /usr/share/' + 'nano-syntax-highlighting/*.nanorc') + def pre_stack(self): """Inital server configuration and tweak""" diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index 7b70f5c..d1f1410 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -368,4 +368,4 @@ class WOFileUtils(): final_file.write('{0}'.format(content)) except IOError as e: Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to write content in {0}".format(path)) + Log.error(self, "Unable to append content in {0}".format(path))