reups_lib/prep.rs
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 * Copyright Nate Lust 2018*/
5
6///Prepping the environment to use reups involves adding functions to
7///the users shell. The string returned from this function adds various
8///components (at this point only rsetup) to the users environment. The
9///resulting string must be eval-ed by the user, most commonly done with
10///eval $(reups prep)
11pub fn build_prep_string() -> &'static str {
12 "rsetup() {
13 local _args=\"$*\";
14 if [[ $_args = *\"-h\"* ]] || [[ $_args = *\"--help\"* ]];
15 then
16 reups setup \"$@\";
17 else
18 eval $(reups setup $_args);
19 fi;
20};
21
22rrestore() {
23eval $(reups env restore $args);
24};
25
26rsave() {
27reups env save $args;
28};
29"
30}