mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 00:00:03 +03:00
Compare commits
8 commits
3dc15ec407
...
769b552c4b
Author | SHA1 | Date | |
---|---|---|---|
769b552c4b | |||
8d0aa11a35 | |||
e2674498c6 | |||
3200581d4d | |||
6afc4840b4 | |||
93aef73eb5 | |||
9cf9a6c532 | |||
469218f7e3 |
|
@ -2550,6 +2550,15 @@
|
|||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "gerases",
|
||||
"name": "gerases",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/8953623?v=4",
|
||||
"profile": "https://github.com/gerases",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 8,
|
||||
|
|
|
@ -360,6 +360,9 @@ authors.
|
|||
<td align="center" valign="top" width="12.5%"><a href="https://github.com/neuschaefer"><img src="https://avatars.githubusercontent.com/u/1021512?v=4?s=100" width="100px;" alt="J. Neuschäfer"/><br /><sub><b>J. Neuschäfer</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=neuschaefer" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="12.5%"><a href="https://scooterhacking.org"><img src="https://avatars.githubusercontent.com/u/58905488?v=4?s=100" width="100px;" alt="Bastian Pedersen"/><br /><sub><b>Bastian Pedersen</b></sub></a><br /><a href="#content-bastianpedersen" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="12.5%"><a href="https://github.com/gerases"><img src="https://avatars.githubusercontent.com/u/8953623?v=4?s=100" width="100px;" alt="gerases"/><br /><sub><b>gerases</b></sub></a><br /><a href="#content-gerases" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ fn build_scores_table(results: String) -> HashMap<String, Team> {
|
|||
let team_2_score: u8 = v[3].parse().unwrap();
|
||||
// TODO: Populate the scores table with details extracted from the
|
||||
// current line. Keep in mind that goals scored by team_1
|
||||
// will be the number of goals conceded from team_2, and similarly
|
||||
// will be the number of goals conceded by team_2, and similarly
|
||||
// goals scored by team_2 will be the number of goals conceded by
|
||||
// team_1.
|
||||
}
|
||||
|
|
51
install.sh
51
install.sh
|
@ -135,34 +135,41 @@ else
|
|||
echo "SUCCESS: Rust is up to date"
|
||||
fi
|
||||
|
||||
Path=${1:-rustlings/}
|
||||
echo "Cloning Rustlings at $Path..."
|
||||
git clone -q https://github.com/rust-lang/rustlings "$Path"
|
||||
|
||||
cd "$Path"
|
||||
|
||||
Version=$(curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | ${PY} -c "import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']) if 'tag_name' in obj else sys.exit(f\"Error: {obj['message']}\");")
|
||||
CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin"
|
||||
|
||||
if [[ -z ${Version} ]]
|
||||
# We don't need to clone if installing in Gitpod.io environment
|
||||
if [[ -z ${GITPOD_WORKSPACE_ID} ]]
|
||||
then
|
||||
echo "The latest tag version could not be fetched remotely."
|
||||
echo "Using the local git repository..."
|
||||
Version=$(ls -tr .git/refs/tags/ | tail -1)
|
||||
if [[ -z ${Version} ]]
|
||||
Path=${1:-rustlings/}
|
||||
|
||||
echo "Cloning Rustlings at $Path..."
|
||||
git clone -q https://github.com/rust-lang/rustlings "$Path"
|
||||
|
||||
cd "$Path"
|
||||
|
||||
Version=$(curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | ${PY} -c "import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']) if 'tag_name' in obj else sys.exit(f\"Error: {obj['message']}\");")
|
||||
CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin"
|
||||
|
||||
if [[ -z ${Version} ]]
|
||||
then
|
||||
echo "No valid tag version found"
|
||||
echo "Rustlings will be installed using the main branch"
|
||||
Version="main"
|
||||
echo "The latest tag version could not be fetched remotely."
|
||||
echo "Using the local git repository..."
|
||||
Version=$(ls -tr .git/refs/tags/ | tail -1)
|
||||
if [[ -z ${Version} ]]
|
||||
then
|
||||
echo "No valid tag version found"
|
||||
echo "Rustlings will be installed using the main branch"
|
||||
Version="main"
|
||||
else
|
||||
Version="tags/${Version}"
|
||||
fi
|
||||
else
|
||||
Version="tags/${Version}"
|
||||
fi
|
||||
else
|
||||
Version="tags/${Version}"
|
||||
fi
|
||||
|
||||
echo "Checking out version $Version..."
|
||||
git checkout -q ${Version}
|
||||
echo "Checking out version $Version..."
|
||||
git checkout -q ${Version}
|
||||
else
|
||||
echo "GITPOD_WORKSPACE_ID found. Skipping git clone and git checkout."
|
||||
fi
|
||||
|
||||
echo "Installing the 'rustlings' executable..."
|
||||
cargo install --force --path .
|
||||
|
|
1
rustlings
Submodule
1
rustlings
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 9a743f80c57cc6bf27819589a8ddb5a5579ab1a4
|
Loading…
Reference in a new issue