Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows batch version of bootstrap Makefile target #3185

Closed
wants to merge 2 commits into from
Closed

Windows batch version of bootstrap Makefile target #3185

wants to merge 2 commits into from

Conversation

michaelbrooks
Copy link

This adds a "make-bootstrap.bat" Windows batch script that duplicates the functionality of the "bootstrap" target from the included Makefile.

I'm working on a Windows system, so I tried to build bootstrap from the Makefile (using Cygwin). However, I found that the Windows version of Node.js was not able to operate while running in Cygwin due to an inability to locate packages with Cygwin's path scheme.

I know you can build bootstrap on Windows manually using lessc (as in #245), and that there might be other ways to get Makefiles to run on Windows that would allow Node.js to operate. Still, I'm assuming there are benefits to using the build script, and if someone already has Node.js installed (with uglify-js and lessc) on their Windows machine, this would make it easier to get the same convenience as the Makefile would allow.

@michaelbrooks
Copy link
Author

Hmm, looks like this might not be the most maintainable approach. Anyway, it needs updating to match the latest Makefile.

For future reference, which branch is the right one to submit changes to?

@kraz
Copy link

kraz commented Aug 31, 2012

Here is a working example of windows'make'like functionality:

Windows batch for simulating twitter bootstrap make functionality

Requirements:

  • node.js
  • npm install -d (or global -g if not already done)
  • for automatic build uppon changed less file (make watch) watchr (+ruby) must be installed

Working: make build, make test, make bootstrap, make gh-pages, make watch
Not working: make haunt

Known issues (differences):

  • The line endings of the combined files is not UNIX like;
  • There is no collored sign "✔" for passed processing (windows batch and UTF... are you serious... easy colors... c'mon)

@ZainShaikh
Copy link

@kraz getting following error on executing your created file:

Running JSHint on javascript...'jshint' is not recognized as an internal or external command
Compiling LESS with Recess...'recess' is not recognized as an internal or external command

Compiling documentation...
module.js:340
throw err;
          ^

@kraz
Copy link

kraz commented Apr 20, 2013

Hey @ZainShaikh,
I double checked, its working as expected even with the latest bootstrap version. I suppose you don't have jshint, recess and less globally installed. Try executing npm install less -g, npm install recess -g, npm install jshint -g. Then try executing make.bat build - this will build the docs and bootstrap itself, or you can just build bootstrap by executing make.bat bootstrap which will create bootstrap directory with the js, css, and img directories inside.

@ZainShaikh
Copy link

@kraz hi, thanks, -g option with the command works, but still getting errors, unable to diagnose:

##################################################
Building Bootstrap...
##################################################

Running JSHint on javascript....\js\bootstrap-affix.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-alert.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-button.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-carousel.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-collapse.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-dropdown.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-modal.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-popover.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-scrollspy.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-tab.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-tooltip.js: line 24, col 17, Bad option: ';_;'.
.\js\bootstrap-transition.js: line 23, col 17, Bad option: ';_;'.
.\js\bootstrap-typeahead.js: line 23, col 17, Bad option: ';_;'.
13 errors
              Done.
Compiling LESS with Recess...                Done.
Compiling documentation...
module.js:340
    throw err;
          ^
Error: Cannot find module 'D:\Zain\github\bootstrap\source\docs\build'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3
                   Done.
Compiling and minifying javascript...WARN: ERROR: Unexpected token: punc (.) [null:1,0]
Error parsing arguments in: .\docs\assets\js\bootstrap.js
        Done.

##################################################
Bootstrap successfully built at 21:58:19.23.
##################################################`

@kraz
Copy link

kraz commented Apr 20, 2013

@ZainShaikh, Ok i got it... it turns out they still use the old versions of the jshint < 1.0 which recognize the ';_;' - the new version doesn't. I updated the make.bat so it honors the local installed tools - just make sure you execute npm install -d into bootstrap directory. As far as Compiling documentation error it looks like you don't have docs\build directory with index.js in it (may be you didn't git clone the repo, but download it from website - try cloning it). If you don't need to compile the docs and syntax check the sources - just execute make.bat bootstrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants