Results 1 to 10 of 12

Thread: Command should return exit code >0 if it hits an error condition:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    87
      0  

    Default Command should return exit code >0 if it hits an error condition:

    Please exit > 0 if the toolset hits an exception along the way. Many of us are writing tools to use this to minify our st2 projects, and we should only have to check to see if [ $? -gt 0 ], but instead, we will now have to check the output for the string "[ERROR]".

    Code:
    JMBP-2:silk jgarcia$ sencha app create blah /var/spool/blah && echo $?
    [ERROR] ENOENT, no such file or directory '/www/npr/silk/version.txt'
    
    Usage:
        sencha app create [arguments...]
    
    Description:
        (Alias to 'sencha generate app') Generate a new project with the recommended structure
    
    Arguments: (*) denotes required parameter
    
          -n, --name     * The namespace of the application to create. This will be used as the prefix for all your classes
          -p, --path     * The directory path to generate this application to.
          -l, --library   The library's build to develop your application with, either 'core' or 'all'. Defaults to 'core'
        
    Examples:
        Long:
          sencha app create --name=MyApp --path=/path/to/myapp --library=all 
    
        Short:
          sencha app create -n MyApp -p /path/to/myapp -l all 
    
        Shortest (arguments must be in the right order):
          sencha app create MyApp /path/to/myapp all 
    
    0

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Vote Rating
    1290
      0  

    Default

    Howdy there partner! Have entered this in. SDKTOOLS-45
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
      0  

    Default

    bump

    Code:
    PATH=$PATH:/Applications/SenchaSDKTools-2.0.0-Beta:/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder/:/Applications/SenchaSDKTools-2.0.0-Beta/bin sencha build -p app.jsb3 -d . && echo "success"
    Project file doesn't exist
    success

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    21
    Vote Rating
    1
      0  

    Default

    Here's a fix, though a bit complicated.

    in sencha.js (the one executed by node, /Applications/SenchaSDKTools-2.0.0-beta3/sencha.js on OSX) add this listener after the child process is spawned. (line 78 in 2.0.0-beta3)
    Code:
    cmd.on('exit', function(errorCode){
        process.exit(errorCode);
    });
    Then within your project you need to alter both Application.js and Cli.js

    Application.js (approximately line 427, src/module/Application.js from your project root)
    Code:
    var error = {};
    error.message = "Failed loading your application from: '"+appUrl+"'. " + (!config.url ? "Try setting the " +
                    "absolute URL to your application for the 'url' item inside 'app.json'" : "");
    throw error;
    And Cli.js (approximately line 80, sdk/command/src/Cli.js from your project root)
    Code:
            process.on('uncaughtException', function(e) {
                if(e.message)
                    this.error(e.message);
                process.exit(1);
            }.bind(this));
    Email me if there is a good place to check out source and i'll submit a proper patch.

  5. #5
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,711
    Vote Rating
    240
      -1  

    Default

    This bug has been fixed in V3 of Sencha Cmd.
    Don Griffin
    Director of Engineering - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    2
    Vote Rating
    1
      1  

    Default Still Occurs in Sencha Cmd v3.1.1.274

    For example,

    I am trying to concatenate and minify my code, but the bundled closure compiler spits out some errors,

    [INF] Concatenating output to file C:\Program Files (x86)\Jenkins\jobs\[...].js[INF] Compressing data with ClosureCompressor[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:190160

    [ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:190660[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:191460[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:192260[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:193060[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:326563[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:519267[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:814863
    [INF] Concatenating output to file C:\Program Files (x86)\Jenkins\jobs\[...].js

    The return code, as indicated by %ERRORLEVEL% is still 0.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •