This file contains hidden or 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
| Red [] | |
| clean-path: func [{Cleans-up '.' and '..' in path; returns the cleaned path} | |
| path [file! url! string!] | |
| /only "Do not prepend current directory" | |
| /dir "Add a trailing / if missing" | |
| /local count e file is-root? is-url? items out prefix s | |
| ][ | |
| count: 0 |
This file contains hidden or 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
| Red [] | |
| join: func ["Concatenate values" | |
| a "Coerced to string if not a series, map, or object" | |
| b {Single value or block of values; reduced if a is not an object or map} | |
| ][ | |
| if all [block? :b not object? :a not map? :a] [b: reduce b] | |
| case [ | |
| series? :a [append copy a :b] | |
| map? :a [extend copy a :b] |
This file contains hidden or 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
| . |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>fileTypes</key> | |
| <array> | |
| <string>r</string> | |
| </array> | |
| <key>foldingStartMarker</key> | |
| <string>\[{?(\s*;.*)*$</string> |
This file contains hidden or 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
| Red [] | |
| #if config/OS <> 'Windows [ | |
| colors: [black red green yellow blue magenta cyan white] | |
| ;https://en.wikipedia.org/wiki/ANSI_escape_code | |
| color: function [s f /bg b /space][ | |
| o: clear {} | |
| s: form s | |
| if space [s: rejoin [{ } s { }]] |
This file contains hidden or 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
| Red [] | |
| ;short version utils: | |
| join: func[a b][append copy a b] | |
| delete: func[f][call/wait rejoin ["rm '" f "'"]] | |
| #include %console.red | |
| system/options/home: join to-file get-env "HOME" %/ |