Skip to content

Commit

Permalink
less preset aspect ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrada committed Jan 3, 2017
1 parent 06650d0 commit 0f00129
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 13 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,18 @@ gulp.task('assemble-plugin-resources',function(callback) {
function normalizePluginFileName(name) {
return name;
}

return gulp.src('src/resources/**/*.*')
.pipe(gulp.dest(path.join(__dirname,'dist',normalizePluginFileName(currentManifest.bundleName || currentManifest.name)+'.sketchplugin','Contents/Resources')));
});

gulp.task('add-custom-ratios',function(callback) {
function normalizePluginFileName(name) {
return name;
}
return gulp.src('src/custom-ratios/**/*.*')
.pipe(gulp.dest(path.join(__dirname,'dist',normalizePluginFileName(currentManifest.bundleName || currentManifest.name)+'.sketchplugin','Contents/Resources')));
});

gulp.task('install-plugin',function(){
return gulp.src("dist/**/*.*")
.pipe(gulp.dest(SKETCH_PLUGINS_FOLDER));
Expand All @@ -150,6 +157,11 @@ gulp.task('build',function(callback) {
runSequence('clean','prepare-folders','bundle','prepare-manifest','assemble-plugin-bundle','assemble-plugin-resources','install-plugin',callback);
});

gulp.task('custom-ratios',function(callback) {
runSequence('clean','prepare-folders','bundle','prepare-manifest','assemble-plugin-bundle','assemble-plugin-resources','add-custom-ratios','install-plugin',callback);
});


gulp.task('bundle',function() {
var filePath = './src/plugin.js';
var extensions = ['.js'];
Expand Down
12 changes: 1 addition & 11 deletions src/resources/ratios.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
module.exports = {
ratios: [
{ x: 1, y: 1 },
{ x: 1, y: 3 },
{ x: 10, y: 16 },
{ x: 16, y: 10 },
{ x: 16, y: 9 },
{ x: 2, y: 3 },
{ x: 21, y: 9 },
{ x: 3, y: 1 },
{ x: 3, y: 2 },
{ x: 3, y: 4 },
{ x: 4, y: 3 },
{ x: 4, y: 5 },
{ x: 5, y: 3 },
{ x: 5, y: 4 },
{ x: 9, y: 16 },
{ x: 9, y: 2 }
{ x: 4, y: 3 }
]
}

0 comments on commit 0f00129

Please sign in to comment.