added a gzip version of the versions file
authorPaul J R <me@pjr.cc>
Wed, 16 Jan 2013 19:59:02 +0000 (06:59 +1100)
committerPaul J R <me@pjr.cc>
Wed, 16 Jan 2013 19:59:02 +0000 (06:59 +1100)
nodejs_dist_list/versions_file.gz [new file with mode: 0644]
tftp/node_modules/.bin/tftp-client [changed from file to symlink]

diff --git a/nodejs_dist_list/versions_file.gz b/nodejs_dist_list/versions_file.gz
new file mode 100644 (file)
index 0000000..83d7948
Binary files /dev/null and b/nodejs_dist_list/versions_file.gz differ
deleted file mode 100755 (executable)
index e48a173aada4dbf745d357bf824c86c316bd7ac7..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env node\r
-\r
-// Require needed modules\r
-var TFTP = require('..'), // The tftp-client module\r
-       fs = require('fs'), // Simple wrappers around standard POSIX functions\r
-       path = require('path'); // Contains utilities for handling and transforming file paths\r
-\r
-/**********************\\r
-|* Validate arguments *|\r
-\**********************/\r
-\r
-// Too few arguments (node + path_to_this_file + host + cmd + file = 5)\r
-if (process.argv.length < 5) {\r
-       // Print usage, and exit\r
-       console.log('Needs atleast 3 arguments (you had %d)', process.argv.length-2);\r
-       console.log('');\r
-       printUsage(true);\r
-}\r
-\r
-// Grab arguments\r
-var host = process.argv[2];\r
-var cmd  = process.argv[3];\r
-var file = process.argv[4];\r
-var port = process.argv[5] || 69; // Port defaults to 69 if omitted\r
-\r
-// If cmd is neither read nor write, print usage & exit\r
-if (['read', 'write'].indexOf(cmd)===-1) {\r
-       console.log('Command must be read or write (you had %s)', cmd);\r
-       printUsage(true);\r
-}\r
-\r
-/*******************\\r
-|* Validation done *|\r
-\*******************/\r
-\r
-// Create the client\r
-var client = new TFTP(port, host);\r
-\r
-var basename = path.basename(file);\r
-\r
-/********\\r
-|* READ *|\r
-\********/\r
-if (cmd == 'read') {\r
-       // Read from server\r
-       client.read(basename, function(err, data) {\r
-               // If error, output some error message\r
-               if (err) {\r
-                       console.error('Oh noes! Error while reading file from tftp server:');\r
-                       console.error(err);\r
-               } else {\r
-\r
-                       // No error, we got the file, lets write it\r
-                       \r
-                       fs.writeFile(file, data, function (err) {\r
-                               \r
-                               // If error, output some error message\r
-                               if (err) {\r
-                                       console.error('Dang it! Error while writing file!');\r
-                                       console.error(err);\r
-                               } else {\r
-\r
-                                       // No error, the file has been written!\r
-\r
-                                       console.log('File saved (%d bytes)', data.length);\r
-                               }\r
-                       });\r
-               }\r
-       });\r
-}\r
-/*********\\r
-|* WRITE *|\r
-\*********/\r
-else if (cmd == 'write') {\r
-       // If file does not exist, print error and usage & exit\r
-       if (!fs.existsSync(file)) {\r
-               console.log('File (%s) does not exist!', file);\r
-               printUsage(true);\r
-       }\r
-\r
-       // Read file first, then send to server\r
-       var data = fs.readFileSync(file);\r
-\r
-       client.write(basename, data, function (err, bytes) {\r
-               if (err) {\r
-                       console.error('ERROR:');\r
-                       console.error(err);\r
-                       return;\r
-               }\r
-\r
-               console.log('File sent (%d bytes)', bytes);\r
-       });\r
-} else {\r
-       console.log('???HOW DID YOU GET HERE???');\r
-}\r
-\r
-/**\r
- * Prints usage - how to use tftp-client\r
- * @param  {boolean} exit Wether it sould exit the process\r
- */\r
-function printUsage(exit) {\r
-       console.log('Usage:');\r
-       console.log('  tftp-client <hostname> (read|write) <filename> [<port>]');\r
-       console.log('');\r
-       console.log('Example:');\r
-       console.log('  tftp-client localhost read 1.txt');\r
-\r
-       if (exit===true)\r
-               process.exit(0);\r
-}
\ No newline at end of file
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..a47905f6b4721077ccb121dc64107458782c747a
--- /dev/null
@@ -0,0 +1 @@
+../tftp-client/bin/tftp.js
\ No newline at end of file