func fetchPhysicalStore()

in internal/diskutil/mojave.go [45:57]


func fetchPhysicalStore(ctx context.Context, id string) (string, error) {
	// Create the command for running diskutil and parsing the output to retrieve the desired info (physical store)
	//   * list - specifies the diskutil 'list' verb for a specific device ID and returns the human-readable output
	cmdPhysicalStore := []string{"diskutil", "list", id}

	// Execute the command to parse output from diskutil list
	out, err := util.ExecuteCommand(ctx, cmdPhysicalStore, "", nil, nil)
	if err != nil {
		return "", fmt.Errorf("%s: %w", out.Stderr, err)
	}

	return parsePhysicalStoreId(out.Stdout)
}