-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6456873
commit 0847679
Showing
37 changed files
with
670 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const appRoot = fs.realpathSync(process.cwd()); | ||
const appRoot = fs.realpathSync(path.resolve(__dirname, '..')); | ||
|
||
const desktopRepo = process.env.RABBY_DESKTOP_REPO || path.join(appRoot, '../RabbyDesktop'); | ||
if (!fs.existsSync(desktopRepo)) { | ||
console.log('RabbyDesktop repo not found at ' + desktopRepo); | ||
desktopRepo = null; | ||
} else { | ||
console.log('Using RabbyDesktop repo at ' + desktopRepo); | ||
}; | ||
|
||
const rootResolve = path.resolve.bind(path, appRoot); | ||
|
||
module.exports = { | ||
root: appRoot, | ||
src: rootResolve('src'), | ||
popupHtml: rootResolve('src/ui/popup.html'), | ||
popupHtml: rootResolve('src/ui/popup.ejs'), | ||
notificationHtml: rootResolve('src/ui/notification.html'), | ||
indexHtml: rootResolve('src/ui/index.html'), | ||
backgroundHtml: rootResolve('src/background/background.html'), | ||
dist: rootResolve('dist'), | ||
dist: desktopRepo ? path.resolve(desktopRepo, './assets/chrome_exts/rabby') : rootResolve('dist'), | ||
|
||
rootResolve, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
script_dir="$( cd "$( dirname "$0" )" && pwd )" | ||
project_dir=$(dirname "$script_dir") | ||
|
||
if [ -z $RABBY_DESKTOP_REPO ]; then | ||
export RABBY_DESKTOP_REPO=$( cd "$project_dir/../RabbyDesktop" && pwd ) | ||
echo "[clean-assets] RABBY_DESKTOP_REPO is not set, use default: $RABBY_DESKTOP_REPO" | ||
else | ||
echo "[clean-assets] RABBY_DESKTOP_REPO is set to: $RABBY_DESKTOP_REPO" | ||
fi | ||
|
||
mkdir -p $RABBY_DESKTOP_REPO/assets/chrome_exts/rabby && rm -rf $RABBY_DESKTOP_REPO/assets/chrome_exts/rabby/* && cp -r _raw/* $RABBY_DESKTOP_REPO/assets/chrome_exts/rabby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
interface Window { | ||
rabbyDesktop: { | ||
ipcRenderer: { | ||
sendMessage<T extends string>( | ||
channel: T, | ||
...args: any[] | ||
): void; | ||
on: { | ||
<T extends string>( | ||
channel: T, | ||
func: (...args: any[]) => void | ||
): (() => void) | undefined; | ||
<T extends string>( | ||
channel: T, | ||
func: (event: any) => void | ||
): (() => void) | undefined; | ||
}; | ||
once: { | ||
<T extends string>( | ||
channel: T, | ||
func: (...args: any[]) => void | ||
): (() => void) | undefined; | ||
<T extends string>( | ||
channel: T, | ||
func: (event: any) => void | ||
): (() => void) | undefined; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.