Skip to content

Instantly share code, notes, and snippets.

@chadwithuhc
chadwithuhc / rename_module.sh
Created October 24, 2012 21:31 — forked from HighwayofLife/rename_module.sh
Rename/Duplicate PyroCMS Module Bash Script
#!/bin/bash
##
# Modified version of https://gist.github.com/3680107
#
# Tested for use on Mac OS X 10.7.5 with Bash 3.2.48(1)-release
#
# Old module needs to be in system/cms/modules and a single word (Ex: blogs not site_blogs)
##
@tkorakas
tkorakas / remove-node-modules.js
Created August 31, 2018 12:14
Recursively remove node_modules folder from all your projects.
const { readdirSync, statSync, existsSync } = require('fs');
const { join } = require('path');
// npm init -y && npm install rimraf
const rimraf = require('rimraf');
if (process.argv.length == 2) throw Error('Required project folder');
const folder = process.argv[2];
const dirs = p => readdirSync(p).filter(f => statSync(join(p, f)).isDirectory());
const myDirs = dirs(folder);
myDirs.filter(proj => existsSync(`./${folder}/${proj}/node_modules`)).map((proj, index) => {