Skip to content

Commit 4ee63fc

Browse files
committed
Update p/ to use ES6 and latest gulp
1 parent f2ca9bf commit 4ee63fc

File tree

5 files changed

+2200
-32
lines changed

5 files changed

+2200
-32
lines changed

README.md

+22-12
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,48 @@ This repository contains the different WebUIs for radare2:
1515

1616
First, you should install [radare2](https://github.com/radare/radare2), then `r2pm` will handle this for you:
1717

18-
$ r2pm -i www-enyo
19-
$ r2pm -i www-m
20-
$ r2pm -i www-p
21-
$ r2pm -i www-t
18+
```console
19+
$ r2pm -i www-enyo
20+
$ r2pm -i www-m
21+
$ r2pm -i www-p
22+
$ r2pm -i www-t
23+
```
2224

2325
This process will install the proper UI by downloading the latest version available.
2426

2527
## Troubleshooting
2628

2729
The Web UIs (/m specifically) are using some tools that require an updated version of `node`, so if you encounter the following error, you should consider an update.
2830

29-
~/radare2-webui/www/m/node_modules/gulp-google-webfonts/index.js:209
30-
request.name = path.posix.join(options.fontsDir, request.name);
31-
TypeError: Cannot call method 'join' of undefined
31+
```console
32+
~/radare2-webui/www/m/node_modules/gulp-google-webfonts/index.js:209
33+
request.name = path.posix.join(options.fontsDir, request.name);
34+
TypeError: Cannot call method 'join' of undefined
35+
```
3236

3337
Updating node is easy, I recommand you to follow this [article](https://davidwalsh.name/upgrade-nodejs):
3438

35-
sudo npm cache clean -f
36-
sudo npm install -g n
37-
sudo n stable
39+
```shell
40+
sudo npm cache clean -f
41+
sudo npm install -g n
42+
sudo n stable
43+
```
3844

3945
# Use it
4046

4147
You can run one of the UI by typing the following command with: `enyo`, `m`, `p` and `t`.
4248

43-
$ r2 -q -e http.ui=<UI> -c=H /bin/ls
49+
```shell
50+
$ r2 -q -e http.ui=<UI> -c=H /bin/ls
51+
```
4452

4553
# Uninstall
4654

4755
To uninstall an UI, you can use this command.
4856

49-
$ r2pm -u <package>
57+
```shell
58+
$ r2pm -u <package>
59+
```
5060

5161
# Soon...
5262

www/p/Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ VERSION=0.1.1
22
DISTZIP=radare2-webui-p-$(VERSION).zip
33

44
build: node_modules
5-
$(shell npm bin)/gulp
5+
npx gulp
66

77
node_modules:
88
npm install
99

1010
dist release:
1111
npm install
12-
$(shell npm bin)/gulp release
12+
npx gulp release
1313
rm -f $(DISTZIP)
1414
cd ../../dist && zip -r $(DISTZIP) p
1515

@@ -19,8 +19,7 @@ run:
1919
r2 -q -e scr.html=0 -e http.sandbox=false -e http.ui=p -e http.root=$(PWD)/../../dev -c=H /bin/ls
2020

2121
watch:
22-
$(shell npm bin)/gulp watch
23-
22+
npx gulp watch
2423

2524
indent:
2625
# TODO: use semistandard

www/p/gulpfile.js

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
const { src, watch, series, dest } = require('gulp');
1+
import { src, series, dest } from 'gulp';
2+
import gulp from 'gulp';
3+
import uglify from 'gulp-uglify';
4+
import concat from 'gulp-concat';
5+
import cleanCSS from 'gulp-clean-css';
26

3-
var uglify = require('gulp-uglify'),
4-
cleanCSS = require('gulp-clean-css'),
5-
concat = require('gulp-concat'),
6-
bower = require('bower');
7+
import bower from 'bower';
78

89
var paths = {
910
r2: '../lib/',
@@ -51,10 +52,10 @@ const _js = series(
5152

5253

5354
const _watch = function() {
54-
watch('./*.html', ['html']);
55-
watch(['./lib/js/*.js'], ['js:main']);
56-
watch(['./lib/js/**/*.js'], ['js:app']);
57-
watch(['./lib/css/**/*.css'], ['js:css']);
55+
gulp.watch('./*.html', ['html']);
56+
gulp.watch(['./lib/js/*.js'], ['js:main']);
57+
gulp.watch(['./lib/js/**/*.js'], ['js:app']);
58+
gulp.watch(['./lib/css/**/*.css'], ['js:css']);
5859
done();
5960
};
6061

@@ -84,7 +85,7 @@ const _copyVendors = function() {
8485
'vendors/jquery/dist/jquery.min.js',
8586
'vendors/jquery.scrollTo/jquery.scrollTo.min.js',
8687
'vendors/jquery.layout/dist/jquery.layout-latest.min.js',
87-
'vendors/jquery-ui/ui/minified/jquery-ui.min.js',
88+
'vendors/jquery-ui/jquery-ui.min.js',
8889
'vendors/jquery-ui-contextmenu/jquery.ui-contextmenu.min.js',
8990
'vendors/onoff/dist/jquery.onoff.min.js',
9091
'vendors/lodash/lodash.min.js',
@@ -128,9 +129,9 @@ const _release = series(
128129
_releaseVendor
129130
);
130131

131-
exports.default = series( _bowerInstall, _copyVendors, _js, _css, _common, _default);
132-
exports.release = series( exports.default, _release)
133-
exports.watch = series( exports.default, _watch)
134-
132+
export const defaultTask = series(_bowerInstall, _copyVendors, _js, _css, _common, _default);
133+
export default defaultTask;
134+
export const release = series(defaultTask, _release);
135+
export const watch = series(defaultTask, _watch);
135136

136137

0 commit comments

Comments
 (0)