Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitffa81b0

Browse files
committed
coerce checks into bools
1 parent61bdd7c commitffa81b0

File tree

8 files changed

+23
-14
lines changed

8 files changed

+23
-14
lines changed

‎lib/atom/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
varrender_1=require('../components/render');
33
varpolyfills_1=require('../services/polyfills');
44
varsubscriptions_1=require('./subscriptions');
5+
varstore_1=require('../store/store');
6+
varAction=require('../actions/actions');
57
functionsetDir(){
68
if(atom.project.rootDirectories.length>0){
79
returnatom.project.rootDirectories[0].path;
@@ -15,11 +17,12 @@ function setWin() {
1517
}
1618
varMain=(function(){
1719
functionMain(){
20+
polyfills_1.default();
1821
window.coderoad={
1922
dir:setDir(),
2023
win:setWin()
2124
};
22-
polyfills_1.default();
25+
store_1.store.dispatch(Action.verifySetup());
2326
this.root=render_1.initRoot();
2427
}
2528
Main.prototype.activate=function(){

‎lib/reducers/checks/check-system.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
varcommand_line_1=require('../../services/command-line');
3+
varminVersion=3;
34
functionnpmVersionThreeOrLater(){
4-
varminVersion=3;
55
returnnewPromise(function(resolve,reject){
66
varthreeOrLater=command_line_1.default('npm','-v').then(function(res){returnparseInt(res,10)>=minVersion;});
77
if(!threeOrLater){

‎lib/reducers/checks/setup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ function verifySetup() {
1414
varchecks={
1515
system:{
1616
node:true,
17-
npm:check_system_1.npmVersionThreeOrLater().then(result)
17+
npm:!!check_system_1.npmVersionThreeOrLater()
1818
},
1919
setup:{
20-
dir:check_setup_1.hasDirectory().then(result),
21-
packageJson:check_setup_1.hasPackageJson().then(result),
22-
tutorial:check_setup_1.hasTutorialDep().then(result)
20+
dir:!!check_setup_1.hasDirectory(),
21+
packageJson:!!check_setup_1.hasPackageJson(),
22+
tutorial:!!check_setup_1.hasTutorialDep()
2323
}
2424
};
2525
checks.passed=verified(checks);

‎src/atom/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import {render, initRoot, togglePanel} from '../components/render';
44
importloadPolyfillsfrom'../services/polyfills';
55
import{onActivate,onDeactivate,addToStatusBar}from'./subscriptions';
66

7+
import{store}from'../store/store';
8+
import*asActionfrom'../actions/actions';
9+
10+
// TODO: find a better place to load globals
11+
712
functionsetDir():string{
813
if(atom.project.rootDirectories.length>0){
914
returnatom.project.rootDirectories[0].path;
@@ -19,11 +24,12 @@ class Main {
1924
root:HTMLElement;
2025
statusBarTile:StatusBar.IStatusBarView;
2126
constructor(){
27+
loadPolyfills();// remove with later version of Chrome
2228
window.coderoad={
2329
dir:setDir(),
2430
win:setWin()
2531
};
26-
loadPolyfills();
32+
store.dispatch(Action.verifySetup());
2733
this.root=initRoot();
2834
}
2935
activate():void{

‎src/reducers/checks/check-system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
importcommandLinefrom'../../services/command-line';
22

3+
constminVersion=3;
34
exportfunctionnpmVersionThreeOrLater():Promise<boolean>{
4-
constminVersion=3;
55
returnnewPromise((resolve,reject)=>{
66
letthreeOrLater:Promise<boolean>=commandLine('npm','-v').then((res:string)=>parseInt(res,10)>=minVersion);
77
if(!threeOrLater){

‎src/reducers/checks/setup.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ export default function verifySetup(): CR.Checks {
2121
letchecks:CR.Checks={
2222
system:{
2323
node:true,
24-
npm:npmVersionThreeOrLater().then(result)
24+
npm:!!npmVersionThreeOrLater()
2525
},
2626
setup:{
27-
dir:hasDirectory().then(result),
28-
packageJson:hasPackageJson().then(result),
29-
tutorial:hasTutorialDep().then(result)
27+
dir:!!hasDirectory(),
28+
packageJson:!!hasPackageJson(),
29+
tutorial:!!hasTutorialDep()
3030
}
3131
};
3232

‎src/reducers/globals/globals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import*asTypefrom'../../actions/actionTypes';
2-
import{setWin,setGlobals}from'./set-globals';
2+
import{setGlobals}from'./set-globals';
33

44
// TODO: refactor out globals into state
55

‎src/reducers/tutorials/check-tutorials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {canUpdateTutorial} from './update-tutorial';
77
lettutorialError='This is an error with the tutorial itself';
88

99
exportfunctionpackageJsonExists():boolean{
10-
console.log('packageJsonExists?')
10+
console.log('packageJsonExists?');
1111
constpathToPackageJson=path.join(window.coderoad.dir,'package.json');
1212
returnfileExists(pathToPackageJson);
1313
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp