Skip to content

Commit f473dd9

Browse files
ScottBobJayBazuziisidore
committed
! F Use remove_abandoned_files.py and approve_all.py
Co-authored-by: Jay Bazuzi <jay@bazuzi.com> Co-authored-by: Llewellyn Falco <llewellyn.falco@gmail.com>
1 parent 3dc5511 commit f473dd9

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

approvaltests/src/main/java/org/approvaltests/internal/logs/ApprovedFileLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class ApprovedFileLog
1010
static
1111
{
1212
FileUtils.writeFile(get(), "");
13-
Once.runAsync(() -> LoggingUtils.downloadScriptIfMissing("detect_and_remove_abandoned"));
13+
Once.runAsync(() -> LoggingUtils.downloadScriptIfMissing("remove_abandoned_files"));
1414
}
1515
public static File get()
1616
{

approvaltests/src/main/java/org/approvaltests/internal/logs/FailedFileLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class FailedFileLog
1010
static
1111
{
1212
FileUtils.writeFile(get(), "");
13+
downloadApproveAllScriptIfMissing();
1314
}
1415
private static void downloadApproveAllScriptIfMissing()
1516
{
@@ -23,7 +24,6 @@ public static File get()
2324
}
2425
public static void log(File received, File approved)
2526
{
26-
downloadApproveAllScriptIfMissing();
2727
File log = get();
2828
FileUtils.appendToFile(log,
2929
String.format("%s -> %s\n", received.getAbsolutePath(), approved.getAbsolutePath()));

approvaltests/src/main/java/org/approvaltests/internal/logs/LoggingUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ public static void downloadScriptIfMissing(String scriptName)
1313
{
1414
try
1515
{
16-
String extension = SystemUtils.isWindowsEnvironment() ? ".bat" : ".sh";
16+
String extension = ".py";
17+
String file = scriptName + extension;
1718
File script = new File(getTempDirectory() + "/" + scriptName + extension);
1819
if (!script.exists())
1920
{
20-
String github = "https://raw.githubusercontent.com/approvals/ApprovalTests.Java/refs/heads/master/";
21-
String file = "resources/" + scriptName + extension;
21+
String github = "https://raw.githubusercontent.com/approvals/ApprovalTests.CommonScripts/refs/heads/main/";
2222
FileUtils.writeFile(script, NetUtils.loadWebPage(github + file, null, Duration.ofSeconds(3)));
2323
script.setExecutable(true);
2424
}

0 commit comments

Comments
 (0)