Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 53 lines (37 sloc) 1.021 kb
ee99867 August "Gus" Mueller oh geeze
authored
1 //
2 // JSTRunnerApplication.m
3 // jstalk
4 //
5 // Created by August Mueller on 2/17/09.
6 // Copyright 2009 Flying Meat Inc. All rights reserved.
7 //
8
9 #import "JSTRunnerApplication.h"
10 #import "JSTalk.h"
11
12 @implementation JSTRunnerApplication
13
14
15 - (void) runScript {
16
17 NSString *scriptPath = [[NSBundle mainBundle] pathForResource:@"main" ofType:@"jstalk"];
18
19 if (!scriptPath) {
20 NSBeep();
21 NSLog(@"Could not find main.jstalk");
22 return;
23 }
24
25 NSString *src = [NSString stringWithContentsOfFile:scriptPath
26 encoding:NSUTF8StringEncoding
27 error:nil];
28
29
30 if (!src) {
31 NSBeep();
32 NSLog(@"Could not load main.jstalk");
33 return;
34 }
35
36 JSTalk *jstalk = [[[JSTalk alloc] init] autorelease];
37
38 [jstalk executeString:src];
39 }
40
41 - (id) init {
42 self = [super init];
43 if (self != nil) {
44 [self runScript];
45 exit(0);
46 }
47 return self;
48 }
49
50
51 @end
52
Something went wrong with that request. Please try again.