Skip to content

Commit 69ce13d

Browse files
authored
Add FreeBSD support (#98)
* Add FreeBSD support FreeBSD can be treated in the same way as Linux for auto launch applications. * modify README to add FreeBSD
1 parent 1394a0a commit 69ce13d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ node-auto-launch
88
Auto-launch your app on login.
99

1010
- :star: Launch any application or executable at startup / login / boot.
11-
- :star: Supports Linux, Mac (via AppleScript or Launch Agent), and Windows.
11+
- :star: Supports Linux, FreeBSD, Mac (via AppleScript or Launch Agent), and Windows.
1212
- :star: Supports [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/) (with or without Squirrel; i.e. even if you're using Electron's built-in [`autoUpdater`](http://electron.atom.io/docs/api/auto-updater/) API).
1313
- :star: Auto-detects your app path for NW.js and Electron apps.
1414
- :star: Supports NW.js and Electron apps in Windows Store (with some caveats).
@@ -93,7 +93,7 @@ Returns a Promise which resolves to a Boolean; `true` if your app is set to laun
9393

9494
## How does it work?
9595

96-
### Linux
96+
### Linux / FreeBSD
9797

9898
A [Desktop Entry](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html) is created; i.e. a `.desktop` file is created in `~/.config/autostart/`.
9999

src/index.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = class AutoLaunch
3939
@api = require './AutoLaunchWindows'
4040
else if /darwin/.test process.platform
4141
@api = require './AutoLaunchMac'
42-
else if /linux/.test process.platform
42+
else if (/linux/.test process.platform) or (/freebsd/.test process.platform)
4343
@api = require './AutoLaunchLinux'
4444
else
4545
throw new Error 'Unsupported platform'

tests/index.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if /^win/.test process.platform
1111
else if /darwin/.test process.platform
1212
isMac = true
1313
executablePath = '/Applications/Calculator.app'
14-
else if /linux/.test process.platform
14+
else if (/linux/.test process.platform) or (/freebsd/.test process.platform)
1515
executablePath = path.resolve path.join './tests/executables', 'hv3-linux-x86'
1616

1717
console.log "Executable being used for tests:", executablePath

0 commit comments

Comments
 (0)