Skip to content

Commit

Permalink
add last modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sethjback committed Dec 18, 2023
1 parent 2750925 commit b58d300
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nex-node/prereq.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"os/exec"
"time"

"github.com/fatih/color"

Expand Down Expand Up @@ -58,16 +59,16 @@ func CheckPreRequisites(config *NodeConfiguration) {
fmt.Printf("✅ Located the firecracker executable in path (%s)\n", cyan(firecrackerBinary))
}

if _, err := os.Stat(config.KernelPath); errors.Is(err, os.ErrNotExist) {
if kInfo, err := os.Stat(config.KernelPath); errors.Is(err, os.ErrNotExist) {
fmt.Printf("⛔ Could not access the virtual machine kernel (%s)\n", red(config.KernelPath))
} else {
fmt.Printf("✅ Able to access the virtual machine kernel (%s)\n", cyan(config.KernelPath))
fmt.Printf("✅ Able to access the virtual machine kernel (%s) Last Modified %s\n", cyan(config.KernelPath), cyan(kInfo.ModTime().Local().Format(time.RFC3339)))
}

if _, err := os.Stat(config.RootFsPath); errors.Is(err, os.ErrNotExist) {
if rfsInfo, err := os.Stat(config.RootFsPath); errors.Is(err, os.ErrNotExist) {
fmt.Printf("⛔ Could not access the virtual machine root fs image (%s)\n", red(config.RootFsPath))
} else {
fmt.Printf("✅ Able to access the virtual machine root fs image (%s)\n", cyan(config.RootFsPath))
fmt.Printf("✅ Able to access the virtual machine root fs image (%s) Last Modified %s\n", cyan(config.RootFsPath), cyan(rfsInfo.ModTime().Local().Format(time.RFC3339)))
}
}

Expand Down

0 comments on commit b58d300

Please sign in to comment.