Update VS Code source list if disabled by OS upgrade

Fixes #24898
This commit is contained in:
Daniel Imms
2017-04-17 10:08:54 -07:00
parent 200c4d1057
commit 6c9ead0321

View File

@@ -61,8 +61,18 @@ NdCFTW7wY0Fb1fWJ+/KTsC4=
mv microsoft.gpg $CODE_TRUSTED_PART
fi
# Install repository source list if it does not already exist
# Install repository source list
WRITE_SOURCE=0
if [ ! -f $CODE_SOURCE_PART ]; then
echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" > $CODE_SOURCE_PART
# Write source list if it does not exist
WRITE_SOURCE=1
elif grep -q "# disabled on upgrade to" /etc/apt/sources.list.d/vscode.list; then
# Write source list if it was disabled by OS upgrade
WRITE_SOURCE=1
fi
if [ "$WRITE_SOURCE" -eq "1" ]; then
echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" > $CODE_SOURCE_PART
fi
fi