Last active
August 7, 2018 11:11
-
-
Save grantwinney/2cd7e963873b0a206b9d5c1582ee0fa2 to your computer and use it in GitHub Desktop.
A script to make mentoring C# solutions on Exercism a little easier
This file contains 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
#!/bin/bash | |
### check for proper usage | |
if [ $# -ne 1 ]; then | |
echo $0: usage: uuid_for_solution | |
exit 1 | |
fi | |
cd ~ | |
### download solution | |
local_solution_path=`exercism download --uuid=$1` # where exercism downloaded solution | |
printf "$local_solution_path\n\n" | |
### append '_orig' to original file name; rename user's solution that starts with \\ | |
cd $local_solution_path | |
find . -name '\\\\*.cs' | while read fname; do | |
norm_name=`echo "$fname" | tr -d '\\'` | |
mv "$norm_name" "$norm_name"_orig | |
mv "\\`basename $fname`" "$norm_name" | |
done | |
### enable all tests (remove skip attribute) | |
sed -i '' 's/(Skip = "Remove to run test")//g' *Test.cs | |
### opt out of data collection and trust the ASP.NET Core HTTPS Development Certificate | |
export DOTNET_CLI_TELEMETRY_OPTOUT='true' # https://aka.ms/dotnet-cli-telemetry | |
dotnet dev-certs https --trust # https://go.microsoft.com/fwlink/?linkid=848054 | |
# https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?tabs=netcore21#additional-tools | |
### run tests and open the solution (add -n to open a new window) | |
dotnet test # https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
open $local_solution_path/*.csproj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment