Changing protocol to Docker

This commit is contained in:
Jeffrey Morgan 2015-03-18 11:51:59 -07:00
parent 4a5162ba23
commit 9e2c11f6d0
2 changed files with 18 additions and 6 deletions

View File

@ -34,10 +34,22 @@ ipc.on('application:quitting', opts => {
});
ipc.on('application:open-url', opts => {
console.log('Creating container');
var url = opts.url.substr(19);
console.log(url);
ContainerStore.create(url, 'latest', () => {});
console.log('Creating container from protocol');
var parser = document.createElement('a');
parser.href = opts.url;
if (parser.protocol !== 'docker:') {
return;
}
var pathname = parser.pathname.replace('//', '');
var slash = pathname.indexOf('/');
var base = pathname.slice(0, slash);
if (base === 'runRepo') {
var repo = pathname.substring(slash + 1);
ContainerStore.create(repo, 'latest', () => {});
}
});
SetupStore.setup().then(() => {

View File

@ -31,10 +31,10 @@
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>kitematic</string>
<string>docker</string>
</array>
<key>CFBundleURLName</key>
<string>Kitematic Session Protocol</string>
<string>Docker App Protocol</string>
</dict>
</array>
</dict>