Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

OSX Installer now assures /usr/local exists (by doing mkdir -p)

  • Loading branch information...
commit 7f7294908688b389fab9bf3d3558138b1e75f396 1 parent af19539
@mschwartz authored
View
2  .gitignore
@@ -23,4 +23,4 @@ mysql-5.1.63/
nasm-2.10.07
silkjs.tgz
nasm
-silkjs-installer-osx
+silkjs-installer-osx*
View
5 osx-installer/create-installer.js
@@ -27,8 +27,11 @@ if (!fs.exists('nasm')) {
chdir('..');
}
+var d = new Date(),
+ filename = 'silkjs-installer-osx-' + d.getMonth() + '-' + d.getDate() + '-' + d.getFullYear();
+
exec('./nasm -fmacho64 tarfile.s -o tarfile.o');
-exec('gcc -o silkjs-installer-osx installer.cpp tarfile.o');
+exec('gcc -o ' + filename + ' installer.cpp tarfile.o');
// fs.chdir('/usr/local');
// console.dir(fs.getcwd());
View
7 osx-installer/installer.cpp
@@ -5,8 +5,13 @@ extern unsigned char tarfile[];
extern const unsigned long tarfile_size;
int main(int ac, char *av[]) {
+ FILE *fp;
// printf("tarfile_size %ld tarfile %08lx\n", tarfile_size, tarfile);
- FILE *fp = popen("sudo -A tar -C /usr/local -xzf -", "w");
+
+ fp = popen("sudo mkdir -p /usr/local", "r");
+ pclose(fp);
+
+ fp = popen("sudo -A tar -C /usr/local -xzf -", "w");
fwrite(tarfile, 1, tarfile_size, fp);
pclose(fp);
printf("done\n");
Please sign in to comment.
Something went wrong with that request. Please try again.