mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-10-19 17:55:16 +02:00
Added ExecAndGetLines util func
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -75,10 +74,7 @@ func GetDevices() []Device {
|
||||
var devices []Device
|
||||
|
||||
cmdArgs := []string{"--raw", "--bytes", "--noheadings"}
|
||||
cmdOutput := utils.Exec("lsblk", cmdArgs)
|
||||
cmdOutputReader := strings.NewReader(cmdOutput)
|
||||
scanner := bufio.NewScanner(cmdOutputReader)
|
||||
scanner.Split(bufio.ScanLines)
|
||||
scanner := utils.ExecAndGetLines("lsblk", cmdArgs)
|
||||
|
||||
var currentDevice Device
|
||||
var currentPartitions []Partition
|
||||
|
||||
Reference in New Issue
Block a user