Skip to content

Commit

Permalink
feat: remove protocol module
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jun 23, 2021
1 parent c286196 commit 2842aee
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 140 deletions.
4 changes: 0 additions & 4 deletions addons/sync/commas.json

This file was deleted.

66 changes: 0 additions & 66 deletions addons/sync/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions addons/sync/locales/zh-CN.json

This file was deleted.

2 changes: 0 additions & 2 deletions api/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as frame from './modules/frame'
import * as i18n from './modules/i18n'
import * as ipcMain from './modules/ipc-main'
import * as keybinding from './modules/keybinding'
import * as protocol from './modules/protocol'
import * as settings from './modules/settings'

export {
Expand All @@ -15,7 +14,6 @@ export {
settings,
frame,
directory,
protocol,
keybinding,
ipcMain,
bundler,
Expand Down
13 changes: 0 additions & 13 deletions api/modules/protocol.ts

This file was deleted.

2 changes: 1 addition & 1 deletion bin/commas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

payload=$(ELECTRON_RUN_AS_NODE=1 ${TERM_PROGRAM_BIN:-node} $(dirname $0)/_context.js cli "$@")
payload=$(ELECTRON_RUN_AS_NODE=1 ${COMMAS_EXE:-node} $(dirname $0)/_context.js cli "$@")
printf '\x1b]539;%s\x1b\\' "$payload"
2 changes: 1 addition & 1 deletion bin/commas-node
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

ELECTRON_RUN_AS_NODE=1 ${TERM_PROGRAM_BIN:-node} "$@"
ELECTRON_RUN_AS_NODE=1 ${COMMAS_EXE:-node} "$@"
7 changes: 0 additions & 7 deletions main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { handleKeyBindingMessages } from './lib/keybinding'
import { handleLauncherMessages } from './lib/launcher'
import { createApplicationMenu, createDockMenu, handleMenuMessages } from './lib/menu'
import { handleMessages } from './lib/message'
import { startServingProtocol, handleProtocolRequest } from './lib/protocol'
import { handleSettingsMessages, useSettings, whenSettingsReady } from './lib/settings'
import { handleTerminalMessages } from './lib/terminal'
import { handleThemeMessages } from './lib/theme'
Expand Down Expand Up @@ -41,7 +40,6 @@ async function initialize() {
createDockMenu()
})
}
startServingProtocol()
createWindow(cwd)
}

Expand Down Expand Up @@ -75,11 +73,6 @@ app.on('will-finish-launching', () => {
const frame = getLastWindow()
frame.webContents.send('open-tab', { cwd: file })
})
// handle custom protocol
app.on('open-url', (event, url) => {
event.preventDefault()
handleProtocolRequest(url)
})
})

app.on('window-all-closed', () => {
Expand Down
36 changes: 0 additions & 36 deletions main/lib/protocol.ts

This file was deleted.

4 changes: 3 additions & 1 deletion main/utils/shell.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as path from 'path'
import { app } from 'electron'
import { userData } from './directory'
import { execa } from './helper'

const BIN_PATH = app.isPackaged
Expand All @@ -17,7 +18,8 @@ function getDefaultEnv() {
LANG: app.getLocale().replace('-', '_') + '.UTF-8',
TERM_PROGRAM: app.name,
TERM_PROGRAM_VERSION: app.getVersion(),
TERM_PROGRAM_BIN: app.getPath('exe'),
COMMAS_EXE: app.getPath('exe'),
COMMAS_USERDATA: userData.path,
PATH: process.env.PATH ? `${process.env.PATH}:${BIN_PATH}` : BIN_PATH,
}
// Fix NVM `npm_config_prefix` error in development environment
Expand Down
2 changes: 1 addition & 1 deletion resources/settings.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"key": "terminal.addon.includes",
"type": "list",
"paradigm": ["string"],
"recommendations": ["cli", "updater", "preference", "proxy", "settings", "theme", "menu", "power-mode", "sync", "landscape"],
"recommendations": ["cli", "updater", "preference", "proxy", "settings", "theme", "menu", "power-mode", "landscape"],
"label": "Enabled Addons",
"comments": [
"List of enabled addon name"
Expand Down

0 comments on commit 2842aee

Please sign in to comment.