Added CPU utility function
Necessary for answering CPU of current machine when determining what kind of functionality should be used when executing scripts on Silicon or Intel based hardware. In this case, it'll answers "M1" when using an Apple Silicon chip. For Intel based machines, nothing will be answered since they use multiple "Processor" fields.
This commit is contained in:
@@ -28,6 +28,13 @@ get_basename() {
|
||||
}
|
||||
export -f get_basename
|
||||
|
||||
# Answers current CPU.
|
||||
# Parameters: None.
|
||||
get_cpu() {
|
||||
printf "%s" "$(system_profiler SPHardwareDataType | awk '/Chip/ {print $3}')"
|
||||
}
|
||||
export -f get_cpu
|
||||
|
||||
# Answers the file extension.
|
||||
# Parameters: $1 (required) - The file name.
|
||||
get_extension() {
|
||||
|
||||
Reference in New Issue
Block a user