chore(snapshot): ignore files to upload

This commit is contained in:
Adam Bradley
2016-02-03 11:55:13 -06:00
parent dd30b9be77
commit 1abe9918ea
3 changed files with 10 additions and 6 deletions

View File

@ -7,13 +7,17 @@ module.exports = function(options) {
var inputDir = path.join(__dirname, '../../dist'); var inputDir = path.join(__dirname, '../../dist');
var uploadQueue = []; var uploadQueue = [];
var ignoreFiles = /(\/test\/|\/ts\/|\/q\/|\/ionic-site\/|\/docs\/|\/examples\/|\/inquirer\/|\/lodash\/|\/tooling\/|\/colors\/|\/bin\/|\.ts$|\.bin|\.map$|\.md$|\.git|\.scss$|\.yml$|\.yaml$|\.dart$|\.txt|\.npm|bower|DS_Store|LICENSE)/i;
function uploadFiles(dir, urlPath) { function uploadFiles(dir, urlPath) {
fs.readdir(dir, function(err, list) { fs.readdir(dir, function(err, list) {
list.forEach(function(file) { list.forEach(function(file) {
var url = urlPath + '/' + file var url = urlPath + '/' + file
if (url.indexOf('/test/') > -1 || url.indexOf('/ionic-site/') > -1 || url.indexOf('/docs/') > -1) return; if (ignoreFiles.test(url)) {
return;
}
fs.stat(dir + '/' + file, function(err, stat) { fs.stat(dir + '/' + file, function(err, stat) {
if (stat && stat.isDirectory()) { if (stat && stat.isDirectory()) {
@ -75,7 +79,7 @@ module.exports = function(options) {
function(err, httpResponse, body) { function(err, httpResponse, body) {
if (err) { if (err) {
uploadData.status = 'failed'; uploadData.status = 'failed';
console.error('Get upload failed:', err); console.error('Get upload failed:', uploadData.url_path, err);
} else { } else {
if (httpResponse.statusCode == 200) { if (httpResponse.statusCode == 200) {
@ -101,7 +105,7 @@ module.exports = function(options) {
setTimeout(postNextUpload, 100); setTimeout(postNextUpload, 100);
if (err) { if (err) {
console.error('Upload failed:', err); console.error('Upload failed:', uploadUrl, err);
uploadData.status = 'failed'; uploadData.status = 'failed';
} else { } else {

View File

@ -9,9 +9,9 @@ exports.config = {
//domain: 'localhost:8080', //domain: 'localhost:8080',
specs: 'dist/e2e/**/*e2e.js', specs: 'dist/e2e/**/*e2e.js',
// specs: 'dist/e2e/input/**/*e2e.js', // specs: 'dist/e2e/button/**/*e2e.js',
sleepBetweenSpecs: 350, sleepBetweenSpecs: 380,
platformDefauls: { platformDefauls: {
browser: 'chrome', browser: 'chrome',

View File

@ -90,7 +90,7 @@ module.exports = function(gulp, argv, buildConfig) {
var chars = 'abcdefghijklmnopqrstuvwxyz'; var chars = 'abcdefghijklmnopqrstuvwxyz';
var id = chars.charAt(Math.floor(Math.random() * chars.length)); var id = chars.charAt(Math.floor(Math.random() * chars.length));
chars += '0123456789'; chars += '0123456789';
while (id.length < 4) { while (id.length < 3) {
id += chars.charAt(Math.floor(Math.random() * chars.length)); id += chars.charAt(Math.floor(Math.random() * chars.length));
} }
return id; return id;