]> khamidou — GitHub mirrors - electron.git/commitdiff
Don't ship frameworks in repository, instead we download them.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 3 Jun 2013 09:57:37 +0000 (17:57 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 3 Jun 2013 09:58:20 +0000 (17:58 +0800)
.gitignore
browser/api/atom_api_auto_updater.cc [new file with mode: 0644]
browser/api/atom_api_auto_updater.h [new file with mode: 0644]
script/lib/polite-curl [new file with mode: 0755]
script/update
script/update-frameworks [new file with mode: 0755]

index 0999ffcd46170736d4074f06bd36454d18884f0e..7eb2ff83c72302e8c27122f18e394bf64e1d448b 100644 (file)
@@ -3,6 +3,7 @@ atom-shell.zip
 version
 build/
 dist/
+frameworks/
 node/
 node_modules/
 vendor/
diff --git a/browser/api/atom_api_auto_updater.cc b/browser/api/atom_api_auto_updater.cc
new file mode 100644 (file)
index 0000000..620a3ad
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "browser/api/atom_api_auto_updater.h"
+
+#include "browser/auto_updater.h"
+
+namespace atom {
+
+namespace api {
+
+AutoUpdater::AutoUpdater(v8::Handle<v8::Object> wrapper)
+    : EventEmitter(wrapper) {
+}
+
+AutoUpdater::~AutoUpdater() {
+}
+
+// static
+void AutoUpdater::Initialize(v8::Handle<v8::Object> target) {
+  v8::HandleScope scope;
+}
+
+}  // namespace api
+
+}  // namespace atom
+
+NODE_MODULE(atom_browser_auto_updater, atom::api::AutoUpdater::Initialize)
diff --git a/browser/api/atom_api_auto_updater.h b/browser/api/atom_api_auto_updater.h
new file mode 100644 (file)
index 0000000..f873583
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_
+#define ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_
+
+#include "browser/api/atom_api_event_emitter.h"
+#include "browser/auto_updater_delegate.h"
+
+namespace atom {
+
+namespace api {
+
+class AutoUpdater : public EventEmitter,
+                    public auto_updater::AutoUpdaterDelegate {
+ public:
+  virtual ~AutoUpdater();
+
+  static void Initialize(v8::Handle<v8::Object> target);
+
+ protected:
+  explicit AutoUpdater(v8::Handle<v8::Object> wrapper);
+
+ private:
+  static v8::Handle<v8::Value> New(const v8::Arguments &args);
+
+  DISALLOW_COPY_AND_ASSIGN(AutoUpdater);
+};
+
+}  // namespace api
+
+}  // namespace atom
+
+#endif  // ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_
diff --git a/script/lib/polite-curl b/script/lib/polite-curl
new file mode 100755 (executable)
index 0000000..dbf5ce4
--- /dev/null
@@ -0,0 +1,14 @@
+if [ -t 0 ] ; then # If stdout is a terminal
+  INTERACTIVE=1
+fi
+
+polite_curl()
+{
+  if [ $INTERACTIVE ] ; then
+    CURL_ARGS="--progress-bar"
+  else
+    CURL_ARGS="-fsS"
+  fi
+
+  curl $CURL_ARGS $*
+}
index 30b9218acd4e8c41e87e4b70219971ba4616c743..444b2896118cb327fa5cd427ea03e17e3f4104fa 100755 (executable)
@@ -4,6 +4,7 @@ set -e
 
 cd "$(dirname "$0")/.."
 
+./script/update-frameworks
 ./script/update-node v0.10.9
 
 gyp --depth . atom.gyp \
diff --git a/script/update-frameworks b/script/update-frameworks
new file mode 100755 (executable)
index 0000000..27a63ee
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+cd "$(dirname $0)/.."
+
+. script/lib/polite-curl
+
+[ -d frameworks ] || mkdir frameworks
+cd frameworks
+
+FRAMEWORKS_URL='https://gh-contractor-zcbenz.s3.amazonaws.com/frameworks'
+
+trap 'rm *.zip' EXIT
+
+echo 'Downloading Quincy...'
+polite_curl "$FRAMEWORKS_URL/Quincy.framework.zip" > Quincy.framework.zip
+
+echo 'Downloading Sparkle...'
+polite_curl "$FRAMEWORKS_URL/Sparkle.framework.zip" > Sparkle.framework.zip
+
+unzip Quincy.framework.zip
+unzip Sparkle.framework.zip