Compare commits

..

No commits in common. 'ffa409e041866213c89753f735ee9c4007bd913e' and '1b0e0d7b0d32e7dba30d2691430c7301b02b9f0c' have entirely different histories.

  1. 2
      logs.lua
  2. 4
      rename-logs.ps1

2
logs.lua

@ -112,7 +112,7 @@ ashita.register_event('incoming_text', function(mode, message, modifiedmode, mod @@ -112,7 +112,7 @@ ashita.register_event('incoming_text', function(mode, message, modifiedmode, mod
-- Create the file name and ensure the path to it exists..
local d = os.date('*t');
local n = string.format('%s_%.4u.%.2u.%.2u.log', name, d.year, d.month, d.day);
local n = string.format('%s_%.2u.%.2u.%.4u.log', name, d.month, d.day, d.year);
local p = string.format('%s/%s/', AshitaCore:GetAshitaInstallPath(), 'chatlogs');
if (not ashita.file.dir_exists(p)) then
ashita.file.create_dir(p);

4
rename-logs.ps1

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
$Search ='^(?<Name>.+)_(?<Month>\d\d).(?<Day>\d\d).(?<Year>\d\d\d\d).(?<Ext>.*)$'
$Replace ='${Name}_${Year}.${Month}.${Day}.${Ext}'
Get-ChildItem | where {$_.name -match $Search} | Rename-Item -NewName {$_.name -replace $Search,$Replace}
Loading…
Cancel
Save