This repository was archived by the owner on Aug 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +88
-30
lines changed Expand file tree Collapse file tree 4 files changed +88
-30
lines changed Original file line number Diff line number Diff line change 1- web-ext-artifacts /
1+ web-ext-artifacts /
2+ manifest.json
3+ __pycache__ /
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import subprocess
2+ import argparse
3+ import settings
4+ import json
5+
6+
7+ def create_manifest_file (target ):
8+ data = settings .MANIFEST_FILE
9+
10+ if target == 'firefox' :
11+ data ['browser_specific_settings' ] = {
12+ 'gecko' : {
13+ 14+ 'strict_min_version' : '57.0'
15+ }
16+ }
17+
18+ with open ('manifest.json' , 'w' , encoding = 'utf-8' ) as f :
19+ json .dump (data , f , indent = 2 )
20+
21+
22+ def switch (target ):
23+ create_manifest_file (target )
24+
25+
26+ def build (target ):
27+ switch (target )
28+
29+ arguments = [
30+ 'web-ext' ,
31+ 'build' ,
32+ '--overwrite-dest' ,
33+ '--ignore-files' ,
34+ ]
35+
36+ arguments .extend (settings .FILES_AND_DIRECTORIES_TO_IGNORE_WHEN_BUILDING )
37+
38+ subprocess .run (arguments , shell = True )
39+
40+
41+ def run ():
42+ arg_parser = argparse .ArgumentParser ()
43+ arg_parser .add_argument ('action' , choices = ['build' , 'switch' ])
44+ arg_parser .add_argument ('target' , choices = ['firefox' , 'chrome' ])
45+
46+ args = arg_parser .parse_args ()
47+
48+ if args .action == 'build' :
49+ build (args .target )
50+ elif args .action == 'switch' :
51+ switch (args .target )
52+
53+ if __name__ == '__main__' :
54+ run ()
Original file line number Diff line number Diff line change 1+ MANIFEST_FILE = {
2+ 'manifest_version' : 2 ,
3+ 'name' : 'GitLab Merge Requests lists enhancer' ,
4+ 'version' : '1.0.0' ,
5+ 'description' : 'An extension that enhance all Merge Requests lists on any instance of Gitlab and GitLab.com' ,
6+ 'homepage_url' : 'https://github.com/EpocDotFr/gitlab-merge-requests-lists-enhancer' ,
7+ 'author' : 'Maxime \' Epoc\' G.' ,
8+ 'icons' : {
9+ '16' : 'images/logo_16.png' ,
10+ '48' : 'images/logo_48.png' ,
11+ '96' : 'images/logo_96.png' ,
12+ '128' : 'images/logo_128.png'
13+ },
14+ 'content_scripts' : [
15+ {
16+ 'matches' : ['*://*/*/*/-/merge_requests' , '*://*/*/*/-/merge_requests?*' ],
17+ 'js' : ['js/content.js' ]
18+ }
19+ ],
20+ 'permissions' : [
21+ '*://*/*/*/-/merge_requests' , '*://*/*/*/-/merge_requests?*'
22+ ]
23+ }
24+
25+ FILES_AND_DIRECTORIES_TO_IGNORE_WHEN_BUILDING = [
26+ 'scripts' ,
27+ 'web-ext-artifacts' ,
28+ 'LICENSE.md' ,
29+ 'README.md' ,
30+ 'screenshot.png' ,
31+ ]
You can’t perform that action at this time.
0 commit comments