Run as user instead of root for dotnet new

This commit is contained in:
William Li 2017-05-03 18:38:41 +00:00 committed by William Lee
parent c9295d1df7
commit fa9c4efc82

View file

@ -2,7 +2,7 @@
echo "This software may collect information about you and your use of the software, and send that to Microsoft." echo "This software may collect information about you and your use of the software, and send that to Microsoft."
echo "Please visit http://aka.ms/dotnet-cli-eula for more information." echo "Please visit http://aka.ms/dotnet-cli-eula for more information."
# Run 'dotnet new' to trigger the first time experience to initialize the cache # Run 'dotnet new' as the user to trigger the first time experience to initialize the cache
echo "Welcome to .NET Core! echo "Welcome to .NET Core!
--------------------- ---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
@ -12,4 +12,4 @@ Telemetry
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry." You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry."
dotnet new > /dev/null 2>&1 || true su - $SUDO_USER -c "dotnet new > /dev/null 2>&1 || true"