Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Add a MacOSImager#7

Open
zamderax wants to merge 4 commits intomainfrom
ma/imager
Open

Add a MacOSImager#7
zamderax wants to merge 4 commits intomainfrom
ma/imager

Conversation

@zamderax
Copy link
Copy Markdown
Member

  1. Add a new package that is called Imager. Right now there is only a MacOSImager. I'll work on the Windows and Linux ones shortly.
  2. It's not integrated into the CLI but the idea is that the CLI should also be able to help a developer get an image file and burn it onto an external drive
  3. Once the CLI functionality is there, we can also integrate into the VSCode Extension (cc @mihai-chiorean )

@zamderax zamderax requested a review from Obbut April 17, 2025 19:59
Comment on lines +101 to +119
if let partitionDisk = DADiskCreateFromBSDName(kCFAllocatorDefault, currentDASession, partitionBsdName) {
if let partitionInfo = DADiskCopyDescription(partitionDisk) as? [String: Any] {
volumeName = partitionInfo[kDADiskDescriptionVolumeNameKey as String] as? String ?? volumeName

if let mountPath = partitionInfo[kDADiskDescriptionVolumePathKey as String] as? URL {
do {
let attributes = try fileManager.attributesOfFileSystem(forPath: mountPath.path)
availableBytes = attributes[.systemFreeSize] as? Int64
} catch {

}
} else {
// print("Partition \(partitionIdentifier) is not mounted.")
}
} else {
// print("Failed to get description for partition \(partitionIdentifier).")
}
} else {
// print("Failed to create DADiskRef for partition \(partitionIdentifier).")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be guard lets

@Obbut
Copy link
Copy Markdown
Contributor

Obbut commented Apr 22, 2025

@zamderax Can you move this over to the https://github.com/apache-edge/edge-agent repo? I'll delete this repo afterwards.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants