Browse Source

rename file command

Kajetan Johannes Hammerle 2 years ago
parent
commit
99ed96fb90
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/me/hammerle/snuviscript/code/FunctionRegistry.java

+ 3 - 0
src/me/hammerle/snuviscript/code/FunctionRegistry.java

@@ -389,6 +389,9 @@ public class FunctionRegistry {
             } catch(Exception ex) {
             }
         });
+        registerConsumer("file.rename", (sc, in) -> {
+            ((File) in[0].get(sc)).renameTo((File) in[1].get(sc));
+        });
         registerFunction("config.new",
                 (sc, in) -> new SnuviConfig(in[0].getString(sc), in[1].getString(sc)));
         registerFunction("config.exists", (sc, in) -> ((SnuviConfig) in[0].get(sc)).exists());