Friday, 25 September 2015

Silly mistakes "Task 'saas' is not in your gulpfile" deploying sass with ionic framework

Here is the log of discussion on IRC


satinder
I am deploying ionic on ubuntu machine, i found an error with gulp
$ gulp saas
$ gulp saas
[12:06:36] Using gulpfile ~/myApp/gulpfile.js
[12:06:36] Task 'saas' is not in your gulpfile
[12:06:36] Please check the documentation for proper gulpfile formatting
joeco
yea this is with deploying to ios, like I said, Android is fine and still is working.
junmin has joined
joeco
it's either a problem with ionic, ios or cordova, but if anyone else serious is making interesting apps they know exactly what I'm talking about.
it's super aggravating.
← junmin has quit (Ping timeout: 240 seconds)
joeco
satinder. in your gulpfile, you need some lines that look somewhat like this:
gulp.task('saas', function() {
});
that's assuming you want to run a 'saas' task. (you maybe meant 'sass')
otherwise, just type 'gulp' as your command, and the 'default' task should run
satinder
joeco: yes it is there
gulp.task('default', ['sass']);
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
joeco
that is not defining a new task. It is saying whatever is in the brackets is a dependency of 'default'
satinder
it is already present there
joeco
it means anything in the brackets has to resolve before 'default' is run.
so if you don't want sass, just erase it from the brackets
satinder
right
joeco
or else make a new .task() with 'sass' as the main name / definition
← dan2k3k4 has quit (Ping timeout: 246 seconds)
joeco
oh I see, you have one there
satinder
yes
joeco
maybe it needs to be listed above the 'default'? just a guess
satinder
ok i am trying that way
joeco
are you sure the 'sass' task has something like this as the last line: .on('end', done);
ilmgb has joined
joeco
you have to call the 'done' so that it knows to start the next task
satinder
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass({
errLogToConsole: true
}))
.pipe(gulp.dest('./www/css/'))
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
});
but still not working
qwebirc95493 has joined
joeco
well I don't know. but one other thing you can try, a really handy and simple/straightforward plugin is run-sequence on npm
i use it. you may restructure your order of gulp tasks, the sequence they run in.
maybe going threough that exercise will reveal why the 'sass' task is messed up.
satinder
okay, i will try that ,,,
It's OK, you're connected again :)
[sinisalo.freenode.net]
*** Looking up your hostname...
*** Checking Ident
*** Couldn't look up your hostname
*** Got Ident response
*** Spoofing your IP
← qwebirc95493 has quit (Ping timeout: 246 seconds)
← blackjid has quit (Ping timeout: 240 seconds)
joeco
satinder, I think I know the real solution
can you check your ionic.project file?
under gulpstartuptasks: [] ... you have a misspelling.
← mickhansen has quit (Ping timeout: 240 seconds)
satinder
joeco: Which file
gulpfile.js
?
joeco
it should be in the root of your project
ionic.project
it is the startup file that is called when you do "ionic run android" or whichever
from there it calls gulpfile.js
satinder
yes it is there
{
"name": "myApp",
"app_id": "",
"gulpStartupTasks": [
"sass",
"watch"
],
"watchPatterns": [
"www/**/*",
"!www/lib/**/*"
]
this is the content of ionic.project file
mickhansen has joined
joeco
hmm.. that's strange. the "sass" matches the "sass" in your gulpfile
so I don't know why it said: Task 'saas' is not in your gulpfile
how about in your "watch" task, back in the gulpfile?
does it depend on "saas"?
satinder
no i don't think so
aasp@1313:~/myApp$ gulp watch
[12:33:25] Using gulpfile ~/myApp/gulpfile.js
[12:33:25] Starting 'watch'...
[12:33:25] Finished 'watch' after 11 ms
dan2k3k4 has joined
satinder
Actually i am not using the default sass files of the ionic project
joeco
oh
wait, your original command you typed was "gulp saas"
that's why
what if you type "gulp sass"
satinder
yes it works!
joeco
ha. took the long way to get there :)
marthinal has joined
satinder
yes, thanks joeco
joeco
sure, n/p

Tuesday, 8 September 2015

Adding two repositories to git.

Looking for adding two repo on same git, or say adding another repository other than origin in the same project.

1. Add first repo:

$ git add remote origin master <project repo url>
$ git push -u origin <branch>

2. Adding Second repo

$ git remote add <user> <project repo url>
$ git push <user> <branch>