Skip to content

Commit

Permalink
Mount host's MNE data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger committed May 27, 2024
1 parent a911699 commit 436fa77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,8 @@
// Do all git-config-related things here, otherwise we may run into problems; see:
// https://github.com/microsoft/vscode-remote-release/issues/6810
"configure-git": "${containerWorkspaceFolder}/.devcontainer/scripts/configure-git.sh"
}
},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/mne_data,target=/home/mne-user/mne_data,type=bind"
]
}
6 changes: 3 additions & 3 deletions .devcontainer/scripts/create-data-dir
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ DIR=~/mne_data

# Check if the directory already exists
if [ -d "$DIR" ]; then
echo "Directory already exists: $DIR"
echo "Found existing MNE data directory: $DIR"
else
# Create the directory since it does not exist
mkdir -p "$DIR"
# Check if the directory creation was successful
if [ $? -eq 0 ]; then
echo "Directory created: $DIR"
echo "MNE data directory created: $DIR"
else
echo "Failed to create directory: $DIR"
echo "Failed to create MNE data directory: $DIR"
exit 1
fi
fi
6 changes: 3 additions & 3 deletions .devcontainer/scripts/create-data-dir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ $newDirectoryPath = "$userProfilePath\mne_data"

# Check if the directory already exists
if (Test-Path -Path $newDirectoryPath) {
Write-Output "Directory already exists: $newDirectoryPath"
Write-Output "Found existing MNE data directory: $newDirectoryPath"
} else {
# Create the directory since it does not exist
try {
New-Item -ItemType Directory -Path $newDirectoryPath -Force
# Verify if the directory was created successfully
if (Test-Path -Path $newDirectoryPath) {
Write-Output "Directory created: $newDirectoryPath"
Write-Output "MNE data directory created: $newDirectoryPath"
} else {
Write-Output "Failed to create directory: $newDirectoryPath"
exit 1
}
} catch {
Write-Output "Error creating directory: $_"
Write-Output "Error creating MNE data directory: $_"
exit 1
}
}

0 comments on commit 436fa77

Please sign in to comment.