added Apple silicon support

This commit is contained in:
Dan Remollino
2023-11-10 03:15:13 -05:00
parent 6c0bf3cbf3
commit 6b5bc6a1d4
3 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,6 @@
## Version 1.15
- added Apple silicon support
## Version 1.14
- added Lua, Perl, Python, Ruby, SASS, XML, and YAML to list of supported languages for auto-commenting
- fixed top/bottom border outputting too long if respective border character setting was greater than one character in length

View File

@ -1,3 +1,15 @@
let architecture = ''
var process = new Process('/usr/bin/uname', { args: ['-m'] });
process.onStdout((line) => {
architecture = line.trim()
})
process.start()
const homebrewFontDir = () => {
if (architecture === 'arm64') return '/opt/homebrew/Cellar/figlet/2.2.5/share/figlet/fonts/'
if (architecture === 'x86_64') return '/usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/'
}
/**
* Convert the supplied text to FIGlet format
*
@ -14,9 +26,9 @@ nova.commands.register('figlet', (workspace, figletArgs, textToConvert, postConv
const fontSubDir = nova.config.get('figlet_text.font', 'string').match(/^.*\/\s*/)
const fontDir = () => {
if (fontSubDir !== null) {
return '/usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/' + fontSubDir
return homebrewFontDir() + fontSubDir
}
return '/usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/'
return homebrewFontDir()
}
let args = ['figlet']
@ -365,7 +377,7 @@ nova.commands.register('figletTextFontPreviewAll', workspace => {
// panel was canceled
if (typeof inputValue === 'undefined') return
const process = new Process('/usr/bin/env', {args: ['showfigfonts', '-d', '/usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/' + fontSubDir, inputValue]})
const process = new Process('/usr/bin/env', {args: ['showfigfonts', '-d', homebrewFontDir() + fontSubDir, inputValue]})
let preview = ''
process.onStdout(line => {

View File

@ -3,7 +3,7 @@
"name": "FIGlet Text",
"organization": "Dan Remollino",
"description": "Convert selected text to FIGlet. Great for adding readable text to the Minimap, creating l33t text headers, and organizing files.",
"version": "1.14",
"version": "1.15",
"categories": ["commands", "formatters"],
"entitlements": {