folder-bookmarkFormatting Paths

This page will go over how to format folder/file paths in Reyveld.

Making folder paths for different platforms at once can be tricky, so Reyveld tries to make paths easier for developers by having a few path formatting features to make sure your logic works on every platform.

Formatting

Rule 1: Never Use Absolute Paths

triangle-exclamation

Incorrect

circle-check

Correct

Rule 2: No backslashes.

triangle-exclamation

Incorrect

circle-check

Correct

Environment Variables

Windows, Linux, and MacOS all have their own way of accessing environment variables, and if want to port Reyveld to more than just those three platforms, we need a universal way of representing variables.

So, I decided to use colons to act as our universal way of expressing variables, as it is not a valid character on most platforms.

triangle-exclamation

Incorrect

circle-check

Correct

Platform Tags

There are many cases when we may want a different path for a specific platform, however we would need to write logic to do so. Platform tags an easy alternative.

circle-info

Structure

<[platform identifier here]>'[path-to]'

Every tag takes a unique three letter identifier to represent a specific platform, and a string right after.

circle-info

Example

You can even have different versions for each platform.

circle-info

Example

If you need a fallback on other platforms, use the any identifier.

circle-info

Example

You can even have one string for multiple identifiers.

circle-info

Example

Last updated