Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX/Linux Support #26

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#Prepros App
.idea
node_modules/
ruby/
#ruby/
ffmpegsumo.dll
icudt.dll
libEGL.dll
libGLESv2.dll
nw.pak
Prepros.exe

npm-debug.log

#################
## Eclipse
#################
Expand Down
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "ruby/gems/bourbon"]
path = ruby/gems/bourbon
url = git://github.com/thoughtbot/bourbon.git
[submodule "ruby/gems/haml"]
path = ruby/gems/haml
url = git://github.com/haml/haml.git
[submodule "ruby/gems/kramdown"]
path = ruby/gems/kramdown
url = git://github.com/gettalong/kramdown.git
[submodule "ruby/gems/susy"]
path = ruby/gems/susy
url = git://github.com/ericam/susy.git
[submodule "ruby/gems/compass"]
path = ruby/gems/compass
url = git://github.com/chriseppstein/compass.git
[submodule "ruby/gems/sass"]
path = ruby/gems/sass
url = git://github.com/nex3/sass.git
Binary file added app/assets/img/icons/icns.icns
Binary file not shown.
3 changes: 0 additions & 3 deletions app/scripts/controllers/SidebarCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ prepros.controller('SidebarCtrl', function ($scope, projectsManager, utils, live
//Function to open live url
$scope.openLiveUrl = function(){


if($scope.selectedProject.config.useCustomServer){

utils.openBrowser($scope.selectedProject.config.customServerUrl);
Expand All @@ -64,8 +63,6 @@ prepros.controller('SidebarCtrl', function ($scope, projectsManager, utils, live

}



};

//Function to remove project
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/TitlebarCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ prepros.controller('TitlebarCtrl', function ($scope, config, utils) {
}
}
});
});
});
4 changes: 1 addition & 3 deletions app/scripts/directives/keyboard-shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ prepros.directive('bindKeyboardShortcuts', function(projectsManager, liveServer,
Mousetrap.bind('ctrl+l', function() {

if(scope.selectedProject.id){

var url = liveServer.getLiveUrl(scope.selectedProject);

utils.openBrowser(url);

}
return false;
});
Expand Down Expand Up @@ -111,4 +109,4 @@ prepros.directive('bindKeyboardShortcuts', function(projectsManager, liveServer,
}
};

});
});
115 changes: 82 additions & 33 deletions app/scripts/services/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ prepros.factory('config', function () {
//Base path
var basePath = path.join(path.dirname(process.execPath), 'app');

if(process.platform !== 'win32')
basePath = path.dirname(path.normalize(decodeURIComponent(window.location.pathname)));

//Package.json file url
var packageFileUrl = path.join(basePath, '../package.json');

Expand All @@ -28,8 +31,14 @@ prepros.factory('config', function () {
//We need package path because everything is relative to this file
var packagePath = path.join(basePath, '..');

var dataPath = "";
//User data path
var dataPath = path.join(process.env.LOCALAPPDATA, 'Prepros/Data');
if(process.platform === 'darwin')
dataPath = path.join(process.env.HOME, '/Library/Prepros/Data');
else if(process.platform === 'win32')
dataPath = path.join(process.env.LOCALAPPDATA, 'Prepros/Data');
else
dataPath = path.join(process.env.HOME, '/.prepros/Data');

//For other Operating Systems
if(!os.type().match(/windows/gi)){
Expand All @@ -55,38 +64,78 @@ prepros.factory('config', function () {
updateFileUrl: 'http://alphapixels.com/prepros/update.json'
};

var ruby = {

path: path.join(packagePath, packageData.ruby.path),
version: packageData.ruby.version,

gems: {
compass: {
path: path.join(packagePath, packageData.ruby.gems.compass.path),
version: packageData.ruby.gems.compass.version
},
sass: {
path: path.join(packagePath, packageData.ruby.gems.sass.path),
version: packageData.ruby.gems.sass.version
},
bourbon: {
path: path.join(packagePath, packageData.ruby.gems.bourbon.path),
version: packageData.ruby.gems.bourbon.version
},
haml: {
path: path.join(packagePath, packageData.ruby.gems.haml.path),
version: packageData.ruby.gems.haml.version
},
kramdown: {
path: path.join(packagePath, packageData.ruby.gems.kramdown.path),
version: packageData.ruby.gems.kramdown.version
},
susy: {
path: path.join(packagePath, packageData.ruby.gems.susy.path),
version: packageData.ruby.gems.susy.version
var ruby = {};

if(process.platform === 'win32')
{
ruby = {

path: path.join(packagePath, packageData.ruby.path),
version: packageData.ruby.version,

gems: {
compass: {
path: path.join(packagePath, packageData.ruby.gems.compass.path),
version: packageData.ruby.gems.compass.version
},
sass: {
path: path.join(packagePath, packageData.ruby.gems.sass.path),
version: packageData.ruby.gems.sass.version
},
bourbon: {
path: path.join(packagePath, packageData.ruby.gems.bourbon.path),
version: packageData.ruby.gems.bourbon.version
},
haml: {
path: path.join(packagePath, packageData.ruby.gems.haml.path),
version: packageData.ruby.gems.haml.version
},
kramdown: {
path: path.join(packagePath, packageData.ruby.gems.kramdown.path),
version: packageData.ruby.gems.kramdown.version
},
susy: {
path: path.join(packagePath, packageData.ruby.gems.susy.path),
version: packageData.ruby.gems.susy.version
}
}
}
};
};
}
else
{
ruby = {

path: packageData.ruby_osx_linux.path,
version: packageData.ruby_osx_linux.version,

gems: {
compass: {
path: path.join(packagePath, packageData.ruby_osx_linux.gems.compass.path),
version: packageData.ruby_osx_linux.gems.compass.version
},
sass: {
path: path.join(packagePath, packageData.ruby_osx_linux.gems.sass.path),
version: packageData.ruby_osx_linux.gems.sass.version
},
bourbon: {
path: path.join(packagePath, packageData.ruby_osx_linux.gems.bourbon.path),
version: packageData.ruby_osx_linux.gems.bourbon.version
},
haml: {
path: path.join(packagePath, packageData.ruby_osx_linux.gems.haml.path),
version: packageData.ruby_osx_linux.gems.haml.version
},
kramdown: {
path: path.join(packagePath, packageData.ruby_osx_linux.gems.kramdown.path),
version: packageData.ruby_osx_linux.gems.kramdown.version
},
susy: {
path: path.join(packagePath, packageData.ruby_osx_linux.gems.susy.path),
version: packageData.ruby_osx_linux.gems.susy.version
}
}
};
}

var user = {};

Expand Down Expand Up @@ -202,4 +251,4 @@ prepros.factory('config', function () {
saveOptions: saveOptions
};

});
});
7 changes: 4 additions & 3 deletions app/scripts/services/fileTypes/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ prepros.factory('sass', function (config, utils, notification) {

var args = [config.ruby.gems.sass.path];

//Force utf-8 encoding
args.push('-E', 'utf-8');
//Force utf-8 encoding (Windows Only)
if(process.platform === 'win32')
args.push('-E', 'utf-8');

//Input and output
args.push(file.input, file.output);
Expand Down Expand Up @@ -146,4 +147,4 @@ prepros.factory('sass', function (config, utils, notification) {
format: format,
compile: compile
};
});
});
6 changes: 5 additions & 1 deletion app/scripts/services/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ prepros.factory('utils', function () {
//Open Browser
function openBrowser(url){

require('child_process').spawn('explorer', [ url ], {detached: true});
if(process.platform !== 'win32') {
require('child_process').spawn('open', [ url ], {detached: true});
} else {
require('child_process').spawn('explorer', [ url ], {detached: true});
}

}

Expand Down
Loading