Skip to content

Commit

Permalink
Mac Installer: unmount all repos
Browse files Browse the repository at this point in the history
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
  • Loading branch information
derrickstolee authored and jeschu1 committed Aug 20, 2019
1 parent ecd7f9a commit 7a11773
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Scalar.Installer.Mac/scripts/Distribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
GIT_PKG_REF_PLACEHOLDER
<installation-check script="InstallationCheck()"/>
<script>
function InstallationCheck(prefix)
function InstallationCheck(prefix)
{
var blockingProcesses = GetBlockingProcesses();
if (blockingProcesses.length > 0)
Expand All @@ -28,24 +28,24 @@
my.result.type = 'Fatal';
return false;
}

return true;
}

function GetBlockingProcesses()
{
var watchList = [ "Scalar.Mount", "git", "gitk", "Wish" ];
var watchList = [ "git", "gitk", "Wish" ];
var blockingProcesses = new Array();
for (var process of watchList)
{
var isRunningCmd = "ps -Ac -o command | grep -w '" + process + "'";
var status = system.run("/bin/bash", "-c", isRunningCmd);
if (status == 0)
if (status == 0)
{
blockingProcesses.push(process);
}
}

return blockingProcesses;
}
</script>
Expand Down
7 changes: 7 additions & 0 deletions Scalar.Installer.Mac/scripts/preinstall
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
#!/bin/bash

SCALARBINPATH="/usr/local/scalar/scalar"
if [ -f "${SCALARBINPATH}" ]; then
unmountCmd="${SCALARBINPATH} service --unmount-all"
echo $unmountCmd
eval $unmountCmd || exit 1
fi

0 comments on commit 7a11773

Please sign in to comment.