Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mtscout6 committed Jan 5, 2012
0 parents commit b37fed0
Show file tree
Hide file tree
Showing 7 changed files with 3,283 additions and 0 deletions.
Binary file added .build-npm-linux.swp
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src"]
path = src
url = git://github.com/SteveSanderson/knockout.git
21 changes: 21 additions & 0 deletions build-npm-linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

OutFile='npm/lib/knockout.js'
rm -rf $OutFile.temp

# Combine the source files
SourceFiles=`grep js < src/build/source-references.js | # Find JS references
sed "s/[ \',]//g" | # Strip off JSON fluff (whitespace, commas, quotes)
sed -e 's/.*/src\/&/' | # Fix the paths by prefixing with ../
tr '\n' ' '` # Combine into single line
cat src/build/amd-pre.js > $OutFile.temp
cat $SourceFiles >> $OutFile.temp
cat src/build/amd-post.js >> $OutFile.temp

# Finalise each file by prefixing with version header and surrounding in function closure
cp src/build/version-header.js $OutFile
cat node-npm-header.js >> $OutFile
echo "(function(window,document,navigator,undefined){" >> $OutFile
cat $OutFile.temp >> $OutFile
echo "})(window,document,navigator);" >> $OutFile
rm -rf $OutFile.temp
4 changes: 4 additions & 0 deletions node-npm-header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var jsdom = require('jsdom').jsdom,
document = jsdom('<html><head></head><body></body></html>'),
window = document.createWindow(),
navigator = window.navigator;
Loading

0 comments on commit b37fed0

Please sign in to comment.