From 5112f305701ed627e8055360b5de2f0ac3a45a4f Mon Sep 17 00:00:00 2001 From: lasers Date: Sun, 19 Oct 2014 08:11:13 -0500 Subject: [PATCH] Added limitation note + excluded permanent data script --- scripts/scriptsave.pl | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/scriptsave.pl b/scripts/scriptsave.pl index ea8fc34b..e6f83c2a 100644 --- a/scripts/scriptsave.pl +++ b/scripts/scriptsave.pl @@ -4,7 +4,7 @@ use Irssi; use File::Basename; use vars qw($VERSION %IRSSI); -$VERSION = '0.03'; +$VERSION = '0.05'; %IRSSI = ( authors => 'lasers', contact => 'lasers on freenode', @@ -13,16 +13,25 @@ $VERSION = '0.03'; license => 'Public Domain', ); -# ──── USAGE: ───── +# ──── USAGE ──── # Outside irssi: -# Remove ~/.irssi/scripts/autorun -# Add "script load scriptsave" to ~/.irssi/startup +# Remove ~/.irssi/scripts/autorun +# Add "script load scriptsave" to ~/.irssi/startup # # Inside irssi: -# /script save +# /help script +# /script save # -# ──── NOTE: ──── +# ──── NOTE ──── # Scripts will be saved to ~/.irssi/config.scriptsave +# +# ──── LIMITATIONS ──── +# This script will not work for scripts with a dash +# in their filenames. If possible, omit them or replace +# them with an underscore. +# ✖ Script-name.pl +# ✔ Script_name.pl +# ✔ Scriptname.pl my $name = basename(__FILE__); $name =~ s/\.[^.]+$//; @@ -43,7 +52,7 @@ sub cmd_save_scripts { unlink $lst; foreach (sort grep(s/::$//, keys %Irssi::Script::)){ open(my $fh, ">>", $lst); - if ($_ ne $name){ + if (($_ ne $name) && ($_ !~ m/data+(\d)/)){ print $fh "$_\n"; } close $fh; @@ -60,4 +69,4 @@ sub cmd_print_help() { } cmd_load_scripts; Irssi::command_bind('script save', 'cmd_save_scripts'); -Irssi::command_bind_last('help', 'cmd_print_help'); +Irssi::command_bind_last('help', 'cmd_print_help'); \ No newline at end of file