added Apple silicon support
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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 => {
 | 
			
		||||
 
 | 
			
		||||
@@ -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": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user