save as admin - handle case for readonly files

This commit is contained in:
Benjamin Pasero
2017-12-14 15:50:16 +01:00
parent 8f18e87477
commit 4e9cd88e37
8 changed files with 111 additions and 55 deletions

View File

@@ -3,11 +3,11 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# If root, ensure that --user-data-dir or --write-elevated-helper is specified
# If root, ensure that --user-data-dir or --sudo-write is specified
if [ "$(id -u)" = "0" ]; then
for i in $@
do
if [[ $i == --user-data-dir=* || $i == --write-elevated-helper ]]; then
if [[ $i == --user-data-dir=* || $i == --sudo-write ]]; then
CAN_LAUNCH_AS_ROOT=1
fi
done