Append workspace basename to guest_path
This commit is contained in:
parent
7864673dcb
commit
3e772152ad
1 changed files with 7 additions and 3 deletions
10
bin/qvm-run
10
bin/qvm-run
|
|
@ -59,8 +59,10 @@ EOF
|
||||||
register_workspace() {
|
register_workspace() {
|
||||||
local workspace_path="$1"
|
local workspace_path="$1"
|
||||||
local hash="$2"
|
local hash="$2"
|
||||||
|
local dir_name
|
||||||
|
dir_name=$(basename "$workspace_path")
|
||||||
local mount_tag="ws_${hash}"
|
local mount_tag="ws_${hash}"
|
||||||
local guest_path="/workspace/${hash}"
|
local guest_path="/workspace/${hash}_${dir_name}"
|
||||||
|
|
||||||
# Create workspaces.json if it doesn't exist
|
# Create workspaces.json if it doesn't exist
|
||||||
if [[ ! -f "$QVM_WORKSPACES_FILE" ]]; then
|
if [[ ! -f "$QVM_WORKSPACES_FILE" ]]; then
|
||||||
|
|
@ -172,11 +174,13 @@ main() {
|
||||||
local workspace_path
|
local workspace_path
|
||||||
workspace_path="$(pwd)"
|
workspace_path="$(pwd)"
|
||||||
|
|
||||||
# Generate workspace hash
|
# Generate workspace hash and guest path
|
||||||
local hash
|
local hash
|
||||||
hash=$(workspace_hash "$workspace_path")
|
hash=$(workspace_hash "$workspace_path")
|
||||||
|
local dir_name
|
||||||
|
dir_name=$(basename "$workspace_path")
|
||||||
|
|
||||||
local guest_path="/workspace/${hash}"
|
local guest_path="/workspace/${hash}_${dir_name}"
|
||||||
|
|
||||||
log_info "Workspace: $workspace_path"
|
log_info "Workspace: $workspace_path"
|
||||||
log_info "Guest path: $guest_path"
|
log_info "Guest path: $guest_path"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue