-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
--class-path scripts | ||
--class-path src | ||
--library tink_core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
import sys.FileSystem; | ||
using Lambda; | ||
using haxe.io.Path; | ||
|
||
/** Deletes all generated files. **/ | ||
function main() { | ||
["js", "js.map"].map(ext -> 'bin/setup_hashlink.$ext').filter(FileSystem.exists).iter(FileSystem.deleteFile); | ||
["lib", "res"].filter(FileSystem.exists).iter(Tools.removeDirectory); | ||
Tools.cleanDirectory("var"); | ||
["lib", "res"].filter(FileSystem.exists).iter(removeDirectory); | ||
cleanDirectory("var"); | ||
} | ||
|
||
/** Recursively deletes all files in the specified `directory`. **/ | ||
private function cleanDirectory(directory: String) for (entry in FileSystem.readDirectory(directory).filter(entry -> entry != ".gitkeep")) { | ||
final path = Path.join([directory, entry]); | ||
FileSystem.isDirectory(path) ? removeDirectory(path) : FileSystem.deleteFile(path); | ||
} | ||
|
||
/** Recursively deletes the specified `directory`. **/ | ||
private function removeDirectory(directory: String) { | ||
cleanDirectory(directory); | ||
FileSystem.deleteDirectory(directory); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
//! --class-path src --library tink_core | ||
import setup_hashlink.Platform; | ||
import sys.io.File; | ||
|
||
/** Updates the version number in the sources. **/ | ||
function main() { | ||
Tools.replaceInFile("package.json", ~/"version": "\d+(\.\d+){2}"/, '"version": "${Platform.packageVersion}"'); | ||
Tools.replaceInFile("README.md", ~/action\/v\d+(\.\d+){2}/, 'action/v${Platform.packageVersion}'); | ||
replaceInFile("package.json", ~/"version": "\d+(\.\d+){2}"/, '"version": "${Platform.packageVersion}"'); | ||
replaceInFile("README.md", ~/action\/v\d+(\.\d+){2}/, 'action/v${Platform.packageVersion}'); | ||
} | ||
|
||
/** Replaces in the specified `file` the substring which the `pattern` matches with the given `replacement`. **/ | ||
private function replaceInFile(file: String, pattern: EReg, replacement: String) | ||
File.saveContent(file, pattern.replace(File.getContent(file), replacement)); |