You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/060_alternates.md
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,16 @@ commas.
23
23
24
24
Each condition is an attribute/value pair, separated by a period. Some
25
25
conditions do not require a "value", and in that case, the period and value can
26
-
be omitted. Most attributes can be abbreviated as a single letter.
26
+
be omitted. Most attributes can be abbreviated as a single letter. Values are
27
+
compared case-insensitive.
27
28
28
29
| Attribute | Meaning |
29
30
| - | - |
30
31
|`arch`, `a`| Valid if the value matches the architecture. Architecture is calculated by running <code>uname ‑m</code>. |
31
32
|`class`, `c`| Valid if the value matches the local.class configuration. Class must be manually set using <code>yadm config local.class <class></code>. |
32
33
|`default`| Valid when no other alternate is valid. |
33
-
|`distro`, `d`| Valid if the value matches the distro. Distro is calculated by running <code>lsb_release ‑si</code> or inspecting <code>/etc/os-release</code> |
34
-
|`distro_family`, `f`| Valid if the value matches the distro family. Distro family is calculated by inspecting the `ID_LIKE`line from <code>/etc/os-release</code> |
34
+
|`distro`, `d`| Valid if the value matches the distro. Distro is calculated by running <code>lsb_release ‑si</code> or inspecting `ID` from <code>/etc/os-release</code> |
35
+
|`distro_family`, `f`| Valid if the value matches the distro family. Distro family is calculated by inspecting `ID_LIKE` from <code>/etc/os-release</code> (or `ID` if `ID_LIKE` isn't found)|
35
36
|`extension`, `e`| A special "condition" that doesn't affect the selection process. Its purpose is instead to allow the alternate file to end with a certain extension to e.g. make editors highlight the content properly. |
36
37
|`hostname`, `h`| Valid if the value matches the short hostname. Hostname is calculated by running <code>uname ‑n</code>, and trimming off any domain. |
37
38
|`os`, `o`| Valid if the value matches the OS. OS is calculated by running <code>uname ‑s</code>. <sup>*</sup> |
@@ -43,9 +44,6 @@ The OS for "Windows Subsystem for Linux" is reported as "WSL", even though uname
43
44
<br/>
44
45
*
45
46
The OS for Linux-like runtimes for Windows (e.g. MinGW, Cygwin) is obtained by running `uname -o`.
46
-
<br/>
47
-
*
48
-
If `lsb_release` is not available, "distro" will be the ID specified in `/etc/os-release`.
49
47
</sup></sub>
50
48
51
49
You may use any number of conditions, in any order. An alternate will only be
@@ -117,9 +115,10 @@ yadm configuration—with the `yadm config` command. The following sets the
117
115
118
116
yadm config local.class Work
119
117
120
-
Similarly, the values of `arch`, `os`, `hostname`, and `user` can be manually
121
-
overridden using the configuration options `local.arch`, `local.os`,
122
-
`local.hostname`, and `local.user`.
118
+
Similarly, the values of `arch`, `os`, `hostname`, `user`, `distro`, and
119
+
`distro_family` can be manually overridden using the configuration options
120
+
`local.arch`, `local.os`, `local.hostname`, `local.user`, `local.distro`, and
121
+
`local.distro-family`.
123
122
124
123
Additional local classes can be defined using the `--add` switch.
0 commit comments