Permalink
Browse files

Added mkdirp dependency

  • Loading branch information...
1 parent 55942a1 commit ed93898b882733e134b1214fcd0206c4d7ea4913 @tj committed Aug 20, 2011
Showing with 3 additions and 36 deletions.
  1. +2 −2 lib/installer.js
  2. +0 −33 lib/utils.js
  3. +1 −1 package.json
View
@@ -13,8 +13,8 @@ var EventEmitter = require('events').EventEmitter
, dirname = require('path').dirname
, basename = require('path').basename
, extname = require('path').extname
+ , mkdir = require('mkdirp').mkdirp
, request = require('request')
- , utils = require('./utils')
, fs = require('fs');
/**
@@ -166,7 +166,7 @@ Installer.prototype.downloadFile = function(asset, file, dest, fn){
fn(err);
} else {
self.emit('file download', asset, path, res);
- utils.mkdir(dest, function(err){
+ mkdir(dest, 0755, function(err){
if (err) return fn(err);
fs.writeFile(path, body, function(err){
if (err) return fn(err);
View
@@ -1,33 +0,0 @@
-
-/*!
- * asset - utils
- * Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>
- * MIT Licensed
- */
-
-/**
- * Module dependencies.
- */
-
-var exec = require('child_process').exec;
-
-/**
- * Cache.
- */
-
-var cache = {};
-
-/**
- * Mkdir -p.
- *
- * @param {String} path
- * @param {Function} fn
- */
-
-exports.mkdir = function(path, fn) {
- if (path == '.' || cache[path]) return fn();
- exec('mkdir -p ' + path, function(err){
- cache[path] = true;
- fn(err);
- });
-};
View
@@ -3,7 +3,7 @@
, "description": "Asset manager"
, "keywords": ["assets", "javascript", "css", "package manager"]
, "author": "TJ Holowaychuk <tj@vision-media.ca>"
- , "dependencies": { "request": "1.9.5" }
+ , "dependencies": { "request": "1.9.5", "mkdirp": "0.0.5" }
, "bin": { "asset": "./bin/asset" }
, "main": "index"
, "engines": { "node": "0.4.x" }

0 comments on commit ed93898

Please sign in to comment.