You've already forked hotpocket
BTHLABS-52: Firefox Desktop Extension
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from invoke import task
|
||||
import json
|
||||
|
||||
from invoke import Context, task
|
||||
from invoke.exceptions import UnexpectedExit
|
||||
|
||||
from hotpocket_workspace_tools import get_workspace_mode
|
||||
@@ -12,18 +14,18 @@ WORKSPACE_MODE = get_workspace_mode()
|
||||
|
||||
|
||||
@task
|
||||
def clean(ctx):
|
||||
def clean(ctx: Context):
|
||||
ctx.run('rm -rf dist/')
|
||||
|
||||
|
||||
@task
|
||||
def test(ctx):
|
||||
def test(ctx: Context):
|
||||
# ctx.run('pytest -v --disable-warnings')
|
||||
print('NOOP')
|
||||
|
||||
|
||||
@task
|
||||
def flake8(ctx):
|
||||
def flake8(ctx: Context):
|
||||
ctx.run('flake8')
|
||||
|
||||
|
||||
@@ -45,12 +47,12 @@ def isort(ctx, check=False, diff=False):
|
||||
|
||||
|
||||
@task
|
||||
def eslint(ctx):
|
||||
def eslint(ctx: Context):
|
||||
ctx.run('yarn run eslint')
|
||||
|
||||
|
||||
@task
|
||||
def lint(ctx):
|
||||
def lint(ctx: Context):
|
||||
ihazsuccess = True
|
||||
|
||||
try:
|
||||
@@ -73,17 +75,17 @@ def lint(ctx):
|
||||
|
||||
|
||||
@task
|
||||
def typecheck(ctx):
|
||||
def typecheck(ctx: Context):
|
||||
ctx.run('mypy .')
|
||||
|
||||
|
||||
@task
|
||||
def django_shell(ctx):
|
||||
def django_shell(ctx: Context):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
@task
|
||||
def ci(ctx):
|
||||
def ci(ctx: Context):
|
||||
ihazsuccess = True
|
||||
|
||||
ci_tasks = [test, lint, typecheck]
|
||||
@@ -98,35 +100,58 @@ def ci(ctx):
|
||||
|
||||
|
||||
@task
|
||||
def setup(ctx):
|
||||
def setup(ctx: Context):
|
||||
print('NOOP')
|
||||
|
||||
|
||||
@task
|
||||
def start_web(ctx):
|
||||
def start_web(ctx: Context):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
@task
|
||||
def start_safari(ctx):
|
||||
def start_safari(ctx: Context):
|
||||
ctx.run('yarn watch:safari')
|
||||
|
||||
|
||||
@task(pre=[clean])
|
||||
def start_chrome(ctx):
|
||||
def start_chrome(ctx: Context):
|
||||
ctx.run('yarn watch:chrome')
|
||||
|
||||
|
||||
@task(pre=[clean])
|
||||
def start_firefox(ctx: Context):
|
||||
ctx.run('yarn watch:firefox')
|
||||
|
||||
|
||||
@task
|
||||
def build_safari(ctx):
|
||||
def build_safari(ctx: Context):
|
||||
ctx.run('yarn build:safari')
|
||||
|
||||
|
||||
@task(pre=[clean])
|
||||
def build_chrome(ctx):
|
||||
def build_chrome(ctx: Context):
|
||||
ctx.run('yarn build:chrome')
|
||||
ctx.run(' '.join([
|
||||
r'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome',
|
||||
'--pack-extension=dist/chrome-production/',
|
||||
'--pack-extension-key=secrets/chrome.pem',
|
||||
]))
|
||||
|
||||
|
||||
@task(pre=[clean])
|
||||
def build_firefox(ctx: Context):
|
||||
ctx.run('yarn build:firefox')
|
||||
|
||||
firefox_secrets = None
|
||||
with open('secrets/firefox.json', 'r', encoding='utf-8') as firefox_secrets_f:
|
||||
firefox_secrets = json.load(firefox_secrets_f)
|
||||
|
||||
with ctx.cd('dist/firefox-production'):
|
||||
ctx.run(' '.join([
|
||||
'web-ext',
|
||||
'sign',
|
||||
'--channel=unlisted',
|
||||
f'--api-key={firefox_secrets["api_key"]}',
|
||||
f'--api-secret={firefox_secrets["api_secret"]}',
|
||||
]))
|
||||
|
||||
Reference in New Issue
Block a user